@omniumretail/shared-resources 0.2.75 → 0.2.76
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
-
import { VacationPlan
|
|
3
|
-
interface ApproveVacationPlanProps extends
|
|
2
|
+
import { VacationPlan } from "../../../../interfaces";
|
|
3
|
+
interface ApproveVacationPlanProps extends UseQueryOptions<VacationPlan> {
|
|
4
4
|
userId: string;
|
|
5
5
|
vacationPlan: string;
|
|
6
6
|
}
|
|
7
|
-
export declare const approveVacationPlanQueryHook: ({ vacationPlan, userId
|
|
7
|
+
export declare const approveVacationPlanQueryHook: ({ vacationPlan, userId }: ApproveVacationPlanProps) => import("@tanstack/react-query").UseMutationResult<VacationPlan, unknown, VacationPlan, unknown>;
|
|
8
8
|
export {};
|
package/package.json
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { VacationPlan
|
|
1
|
+
import { useMutation, useQueryClient, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { VacationPlan } from "../../../../interfaces";
|
|
3
3
|
import { putAuth0 } from "../../../../services/ApiService";
|
|
4
4
|
|
|
5
|
-
interface ApproveVacationPlanProps extends
|
|
5
|
+
interface ApproveVacationPlanProps extends UseQueryOptions<VacationPlan> {
|
|
6
6
|
userId: string;
|
|
7
7
|
vacationPlan: string;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export const approveVacationPlanQueryHook = ({ vacationPlan, userId
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
pUserId: userId
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
export const approveVacationPlanQueryHook = ({ vacationPlan, userId }: ApproveVacationPlanProps) => {
|
|
11
|
+
const queryClient = useQueryClient();
|
|
12
|
+
return useMutation<VacationPlan, unknown, VacationPlan>((data: VacationPlan) => {
|
|
13
|
+
return putAuth0(`/AACP/UserVacationPlans/${vacationPlan}/Approve?`, {
|
|
14
|
+
pUserId: userId
|
|
15
|
+
}, data);
|
|
16
|
+
}, {
|
|
17
|
+
onSuccess: (data: VacationPlan) => {
|
|
18
|
+
queryClient.setQueryData(
|
|
19
|
+
['APROVE_VACATION_PLAN_QUERY'], data);
|
|
20
|
+
},
|
|
21
|
+
});
|
|
18
22
|
}
|
|
23
|
+
|