@omniumretail/shared-resources 0.2.78 → 0.2.79
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.
- package/dist/bundle.js +1 -1
- package/dist/types/hooks/Others/Vacation/others/rejectVacationPlanQuery.hook.d.ts +8 -0
- package/dist/types/hooks/Others/changePasswordQuery.hook.d.ts +5 -0
- package/dist/types/hooks/Others/unblockUserQuery.hook.d.ts +1 -0
- package/dist/types/hooks/index.d.ts +3 -0
- package/dist/types/interfaces/User.d.ts +2 -0
- package/dist/types/interfaces/VacationPlan.d.ts +1 -0
- package/package.json +1 -1
- package/src/hooks/Others/Vacation/others/rejectVacationPlanQuery.hook.ts +23 -0
- package/src/hooks/Others/changePasswordQuery.hook.ts +21 -0
- package/src/hooks/Others/unblockUserQuery.hook.ts +14 -0
- package/src/hooks/index.ts +3 -0
- package/src/interfaces/User.ts +2 -0
- package/src/interfaces/VacationPlan.ts +1 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { VacationPlan } from "../../../../interfaces";
|
|
3
|
+
interface RejectVacationPlanProps extends UseQueryOptions<VacationPlan> {
|
|
4
|
+
userId: string;
|
|
5
|
+
vacationPlan: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const rejectVacationPlanQueryHook: ({ vacationPlan, userId }: RejectVacationPlanProps) => import("@tanstack/react-query").UseMutationResult<VacationPlan, unknown, VacationPlan, unknown>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const unblockUserQueryHook: (userId: string) => import("@tanstack/react-query").UseMutationResult<boolean, unknown, void, unknown>;
|
|
@@ -328,3 +328,6 @@ export * from "./Others/editBellNotificationsStatusQuery.hook";
|
|
|
328
328
|
export * from "./Others/Vacation/get/getVacationPlanQuery.hook";
|
|
329
329
|
export * from "./Others/Vacation/others/aproveVacationPlanQuery.hook";
|
|
330
330
|
export * from "./Others/Vacation/others/postVacationPlanQuery.hook";
|
|
331
|
+
export * from "./Others/Vacation/others/rejectVacationPlanQuery.hook";
|
|
332
|
+
export * from "./Others/changePasswordQuery.hook";
|
|
333
|
+
export * from "./Others/unblockUserQuery.hook";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { VacationPlan } from "./VacationPlan";
|
|
1
2
|
export interface User {
|
|
2
3
|
UserId: string;
|
|
3
4
|
DisplayName: string;
|
|
@@ -19,6 +20,7 @@ export interface User {
|
|
|
19
20
|
ImageURL: string;
|
|
20
21
|
Image: string;
|
|
21
22
|
AcceptsTermsAndConditions: boolean;
|
|
23
|
+
VacationPlans: VacationPlan[];
|
|
22
24
|
}
|
|
23
25
|
interface JobTitle {
|
|
24
26
|
Id: string;
|
package/package.json
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useMutation, useQueryClient, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { VacationPlan } from "../../../../interfaces";
|
|
3
|
+
import { putAuth0 } from "../../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
interface RejectVacationPlanProps extends UseQueryOptions<VacationPlan> {
|
|
6
|
+
userId: string;
|
|
7
|
+
vacationPlan: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const rejectVacationPlanQueryHook = ({ vacationPlan, userId }: RejectVacationPlanProps) => {
|
|
11
|
+
const queryClient = useQueryClient();
|
|
12
|
+
return useMutation<VacationPlan, unknown, VacationPlan>((data: VacationPlan) => {
|
|
13
|
+
return putAuth0(`/AACP/UserVacationPlans/${vacationPlan}/Reject?`, {
|
|
14
|
+
pUserId: userId
|
|
15
|
+
}, data);
|
|
16
|
+
}, {
|
|
17
|
+
onSuccess: (data: VacationPlan) => {
|
|
18
|
+
queryClient.setQueryData(
|
|
19
|
+
['REJECT_VACATION_PLAN_QUERY'], data);
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { putAuth0 } from "../../services/ApiService";
|
|
3
|
+
|
|
4
|
+
export interface ChangePasswordProps {
|
|
5
|
+
userId: string;
|
|
6
|
+
password: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const changePasswordQueryHook = ({ userId, password }: ChangePasswordProps) => {
|
|
10
|
+
const queryClient = useQueryClient();
|
|
11
|
+
return useMutation<boolean, unknown>(() => {
|
|
12
|
+
return putAuth0(`/AACP/Users/${userId}/changePassword?`, {
|
|
13
|
+
pPassword: password
|
|
14
|
+
});
|
|
15
|
+
}, {
|
|
16
|
+
onSuccess: (data) => {
|
|
17
|
+
queryClient.setQueryData(
|
|
18
|
+
['CHANGE_PASSWORD_QUERY'], data);
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { postAuth0 } from "../../services/ApiService";
|
|
3
|
+
|
|
4
|
+
export const unblockUserQueryHook = (userId: string) => {
|
|
5
|
+
const queryClient = useQueryClient();
|
|
6
|
+
return useMutation<boolean, unknown>(() => {
|
|
7
|
+
return postAuth0(`/AACP/Users/${userId}/unblock`, undefined);
|
|
8
|
+
}, {
|
|
9
|
+
onSuccess: (data) => {
|
|
10
|
+
queryClient.setQueryData(
|
|
11
|
+
['UNBLOCK_USER_QUERY'], data);
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
}
|
package/src/hooks/index.ts
CHANGED
|
@@ -393,3 +393,6 @@ export * from "./Others/editBellNotificationsStatusQuery.hook";
|
|
|
393
393
|
export * from "./Others/Vacation/get/getVacationPlanQuery.hook";
|
|
394
394
|
export * from "./Others/Vacation/others/aproveVacationPlanQuery.hook";
|
|
395
395
|
export * from "./Others/Vacation/others/postVacationPlanQuery.hook";
|
|
396
|
+
export * from "./Others/Vacation/others/rejectVacationPlanQuery.hook";
|
|
397
|
+
export * from "./Others/changePasswordQuery.hook";
|
|
398
|
+
export * from "./Others/unblockUserQuery.hook";
|
package/src/interfaces/User.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { VacationPlan } from "./VacationPlan";
|
|
1
2
|
|
|
2
3
|
export interface User {
|
|
3
4
|
UserId: string;
|
|
@@ -20,6 +21,7 @@ export interface User {
|
|
|
20
21
|
ImageURL: string;
|
|
21
22
|
Image: string;
|
|
22
23
|
AcceptsTermsAndConditions: boolean;
|
|
24
|
+
VacationPlans: VacationPlan[];
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
interface JobTitle {
|