mirror of
https://github.com/docmost/docmost.git
synced 2025-11-15 06:11:08 +10:00
@ -26,6 +26,7 @@ import {
|
||||
IWorkspace,
|
||||
} from "@/features/workspace/types/workspace.types.ts";
|
||||
import { IUser } from "@/features/user/types/user.types.ts";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export function useWorkspaceQuery(): UseQueryResult<IWorkspace, Error> {
|
||||
return useQuery({
|
||||
@ -92,12 +93,13 @@ export function useGetInviteLink(
|
||||
}
|
||||
|
||||
export function useCreateInvitationMutation() {
|
||||
const { t } = useTranslation();
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
return useMutation<void, Error, ICreateInvite>({
|
||||
mutationFn: (data) => createInvitation(data),
|
||||
onSuccess: (data, variables) => {
|
||||
notifications.show({ message: "Invitation sent" });
|
||||
notifications.show({ message: t("Invitation sent") });
|
||||
queryClient.refetchQueries({
|
||||
queryKey: ["invitations"],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user