@teincfood/core 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -38,6 +38,10 @@ export declare function useAcceptFleetInvitationMutation(): import("@tanstack/re
|
|
|
38
38
|
export declare function useAcceptBusinessInvitationMutation(): import("@tanstack/react-query").UseMutationResult<unknown, Error, {
|
|
39
39
|
code: string;
|
|
40
40
|
}, unknown>;
|
|
41
|
+
export declare function useDeclineBusinessInvitationMutation(): import("@tanstack/react-query").UseMutationResult<unknown, Error, {
|
|
42
|
+
code: string;
|
|
43
|
+
}, unknown>;
|
|
44
|
+
export declare function useResendMemberInvitationMutation(): import("@tanstack/react-query").UseMutationResult<unknown, Error, string, unknown>;
|
|
41
45
|
export declare function useBusinessRolesQuery(enabled?: boolean): import("@tanstack/react-query").UseQueryResult<unknown, Error>;
|
|
42
46
|
export declare function useBusinessTaxRulesQuery(enabled?: boolean): import("@tanstack/react-query").UseQueryResult<unknown, Error>;
|
|
43
47
|
export declare function useCreateTaxRuleMutation(): import("@tanstack/react-query").UseMutationResult<unknown, Error, Record<string, unknown>, unknown>;
|
|
@@ -209,6 +209,39 @@ export function useAcceptBusinessInvitationMutation() {
|
|
|
209
209
|
},
|
|
210
210
|
});
|
|
211
211
|
}
|
|
212
|
+
export function useDeclineBusinessInvitationMutation() {
|
|
213
|
+
const queryClient = useQueryClient();
|
|
214
|
+
return useMutation({
|
|
215
|
+
mutationFn: (data) => {
|
|
216
|
+
assertOnlineFor("member:manage");
|
|
217
|
+
return businessService.declineBusinessInvitation(data);
|
|
218
|
+
},
|
|
219
|
+
onSuccess: () => {
|
|
220
|
+
notifySuccess("Invitation declined");
|
|
221
|
+
queryClient.invalidateQueries({ queryKey: INVITATION_KEYS.list() });
|
|
222
|
+
},
|
|
223
|
+
onError: (error) => {
|
|
224
|
+
notifyError(extractApiErrorMessage(error));
|
|
225
|
+
},
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
export function useResendMemberInvitationMutation() {
|
|
229
|
+
const queryClient = useQueryClient();
|
|
230
|
+
const businessId = useBusinessId();
|
|
231
|
+
return useMutation({
|
|
232
|
+
mutationFn: (invitationId) => {
|
|
233
|
+
assertOnlineFor("member:manage");
|
|
234
|
+
return businessService.resendBusinessMemberInvitation(businessId, invitationId);
|
|
235
|
+
},
|
|
236
|
+
onSuccess: () => {
|
|
237
|
+
notifySuccess("Invitation resent");
|
|
238
|
+
queryClient.invalidateQueries({ queryKey: MEMBER_KEYS.invitations(businessId ?? "") });
|
|
239
|
+
},
|
|
240
|
+
onError: (error) => {
|
|
241
|
+
notifyError(extractApiErrorMessage(error));
|
|
242
|
+
},
|
|
243
|
+
});
|
|
244
|
+
}
|
|
212
245
|
// ─── Roles ───
|
|
213
246
|
export function useBusinessRolesQuery(enabled = true) {
|
|
214
247
|
const businessId = useBusinessId();
|
package/package.json
CHANGED