Skip to content

Commit

Permalink
Create: hook to remove provider from organziation
Browse files Browse the repository at this point in the history
  • Loading branch information
georgipavlov-7DIGIT committed Sep 13, 2024
1 parent 7fae6dd commit 76ca977
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/hooks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ export * from "./useCreateOrganization.js";
export * from './useGetOrganizationById';

Check failure on line 38 in src/hooks/index.js

View workflow job for this annotation

GitHub Actions / ESLint

src/hooks/index.js#L38

Strings must use doublequote (quotes)
export * from './useGetAllProviderNames';

Check failure on line 39 in src/hooks/index.js

View workflow job for this annotation

GitHub Actions / ESLint

src/hooks/index.js#L39

Strings must use doublequote (quotes)
export * from './useAssignProvidersToOrganization';

Check failure on line 40 in src/hooks/index.js

View workflow job for this annotation

GitHub Actions / ESLint

src/hooks/index.js#L40

Strings must use doublequote (quotes)
export * from './useRemoveProviderFromOrganization';

Check failure on line 41 in src/hooks/index.js

View workflow job for this annotation

GitHub Actions / ESLint

src/hooks/index.js#L41

Strings must use doublequote (quotes)
17 changes: 17 additions & 0 deletions src/hooks/useRemoveProviderFromOrganization.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { useMutation } from "@tanstack/react-query";
import { organizationSvc } from "@USupport-components-library/services";
import { useError } from "./useError";

export const useRemoveProviderFromOrganization = (onSuccess, onError) => {
return useMutation({
mutationFn: async (data) => {
return await organizationSvc.removeProviderFromOrganization(data);
},
onSuccess,
onError: (error) => {
const { message: errorMessage } = useError(error);
onError(errorMessage);
},
});
};
export default useRemoveProviderFromOrganization;

0 comments on commit 76ca977

Please sign in to comment.