@omniumretail/shared-resources 0.1.31 → 0.1.32
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/getWeeklyWorkloadQuery.hook.d.ts +10 -0
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/interfaces/Workload.d.ts +7 -0
- package/dist/types/interfaces/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/hooks/Others/getWeeklyWorkloadQuery.hook.ts +23 -0
- package/src/hooks/index.ts +1 -0
- package/src/interfaces/Workload.ts +8 -0
- package/src/interfaces/index.ts +1 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { Workload, ResponseList } from "../../interfaces";
|
|
3
|
+
interface WeeklyWorkloadQueryHookQueryProps extends Omit<UseQueryOptions<ResponseList<"WeeklyWorkHours", Workload>>, "queryKey"> {
|
|
4
|
+
page?: number;
|
|
5
|
+
records?: number;
|
|
6
|
+
sortBy?: string;
|
|
7
|
+
sortDirection?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const getWeeklyWorkloadQueryHook: ({ page, records, sortBy, sortDirection, ...options }: WeeklyWorkloadQueryHookQueryProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"WeeklyWorkHours", Workload>, unknown>;
|
|
10
|
+
export {};
|
|
@@ -52,3 +52,4 @@ export * from './Others/useCreateNotification.hook';
|
|
|
52
52
|
export * from './Others/postCheckoutsMutateQuery.hook';
|
|
53
53
|
export * from './Others/postVerifyUserQuery.hook';
|
|
54
54
|
export * from './Others/postVerifyImageQuery.hook';
|
|
55
|
+
export * from './Others/getWeeklyWorkloadQuery.hook';
|
package/package.json
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { Workload, ResponseList } from "../../interfaces";
|
|
3
|
+
import { getAuth0 } from "../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
interface WeeklyWorkloadQueryHookQueryProps extends Omit<UseQueryOptions<ResponseList<"WeeklyWorkHours", Workload>>, "queryKey"> {
|
|
6
|
+
page?: number;
|
|
7
|
+
records?: number;
|
|
8
|
+
sortBy?: string;
|
|
9
|
+
sortDirection?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const getWeeklyWorkloadQueryHook = ({ page, records, sortBy, sortDirection, ...options }: WeeklyWorkloadQueryHookQueryProps) => {
|
|
13
|
+
return useQuery(
|
|
14
|
+
['WORKLOAD_QUERY', page, records, sortBy, sortDirection],
|
|
15
|
+
() => getAuth0<ResponseList<"WeeklyWorkHours", Workload>>('/AACP/WeeklyWorkHours', {
|
|
16
|
+
pPage: page || 1,
|
|
17
|
+
pRecords: records || 195,
|
|
18
|
+
pSortBy: 'WorkHours',
|
|
19
|
+
pSortDirection: sortDirection || 'asc',
|
|
20
|
+
}),
|
|
21
|
+
options
|
|
22
|
+
);
|
|
23
|
+
}
|
package/src/hooks/index.ts
CHANGED
|
@@ -71,3 +71,4 @@ export * from './Others/useCreateNotification.hook';
|
|
|
71
71
|
export * from './Others/postCheckoutsMutateQuery.hook';
|
|
72
72
|
export * from './Others/postVerifyUserQuery.hook';
|
|
73
73
|
export * from './Others/postVerifyImageQuery.hook';
|
|
74
|
+
export * from './Others/getWeeklyWorkloadQuery.hook';
|
package/src/interfaces/index.ts
CHANGED