mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 10:18:16 +00:00
20 lines
774 B
TypeScript
20 lines
774 B
TypeScript
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
|
|
import { apiRequest } from "@app/config/request";
|
|
import { externalGroupOrgRoleMappingKeys } from "@app/hooks/api/externalGroupOrgRoleMappings/queries";
|
|
import { TSyncExternalGroupOrgRoleMappingsDTO } from "@app/hooks/api/externalGroupOrgRoleMappings/types";
|
|
|
|
export const useUpdateExternalGroupOrgRoleMappings = () => {
|
|
const queryClient = useQueryClient();
|
|
return useMutation({
|
|
mutationFn: async (payload: TSyncExternalGroupOrgRoleMappingsDTO) => {
|
|
const { data } = await apiRequest.put("/api/v1/external-group-mappings", payload);
|
|
|
|
return data;
|
|
},
|
|
onSuccess: () => {
|
|
queryClient.invalidateQueries({ queryKey: externalGroupOrgRoleMappingKeys.list() });
|
|
}
|
|
});
|
|
};
|