Skip to content

Commit

Permalink
Create: hook to assign providers to organization
Browse files Browse the repository at this point in the history
  • Loading branch information
georgipavlov-7DIGIT committed Sep 13, 2024
1 parent 509050b commit 75cbdbd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/hooks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ export * from "./useGetOrganizationsWithDetails.js";
export * from "./useEditOrganization.js";
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)
18 changes: 18 additions & 0 deletions src/hooks/useAssignProvidersToOrganization.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { useMutation } from "@tanstack/react-query";
import { organizationSvc } from "@USupport-components-library/services";
import { useError } from "./useError";

export const useAssignProvidersToOrganization = (onSuccess, onError) => {
return useMutation({
mutationFn: async (data) => {
console.log("here");
return await organizationSvc.assignProvidersToOrganization(data);
},
onSuccess,
onError: (error) => {
const { message: errorMessage } = useError(error);
onError(errorMessage);
},
});
};
export default useAssignProvidersToOrganization;

0 comments on commit 75cbdbd

Please sign in to comment.