@omniumretail/shared-resources 0.1.93 → 0.1.95
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/Analytics/get/getArchivedAnalyticsQuery.hook.d.ts +11 -0
- package/dist/types/hooks/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/hooks/Analytics/get/getArchivedAnalyticsQuery.hook.ts +28 -0
- package/src/hooks/Store/useAllStoreQuery.hook.ts +1 -1
- package/src/hooks/index.ts +1 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { AnalyticsUserId, ResponseList } from "../../../interfaces";
|
|
3
|
+
export interface ArchivedAnalyticsQuery extends UseQueryOptions<ResponseList<"UserEvaluationCycleDTOs", AnalyticsUserId>> {
|
|
4
|
+
page?: number;
|
|
5
|
+
records?: number;
|
|
6
|
+
pYear?: string;
|
|
7
|
+
userId: string;
|
|
8
|
+
sortBy?: string;
|
|
9
|
+
sortDirection?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const getArchivedAnalyticsQueryHook: ({ page, records, userId, pYear, sortBy, sortDirection }: ArchivedAnalyticsQuery) => import("@tanstack/react-query").UseQueryResult<ResponseList<"UserEvaluationCycleDTOs", AnalyticsUserId>, unknown>;
|
|
@@ -34,6 +34,7 @@ export * from './Analytics/get/useAnalyticsUserIdQuery.hook';
|
|
|
34
34
|
export * from './Analytics/get/useAnalyticsQuestionsQuery.hook';
|
|
35
35
|
export * from './Analytics/get/useAnalyticsSideBarQuery.hook';
|
|
36
36
|
export * from './Analytics/get/useAnalyticsUserQuery.hook';
|
|
37
|
+
export * from './Analytics/get/getArchivedAnalyticsQuery.hook';
|
|
37
38
|
export * from './Answer/get/useAnswerIdQuery.hook';
|
|
38
39
|
export * from './Answer/mutate/useAnswerMutateQuery.hook';
|
|
39
40
|
export * from './Answer/get/useAnswersUserSupervisorQuery.hook';
|
package/package.json
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { AnalyticsUserId, ResponseList } from "../../../interfaces";
|
|
3
|
+
import { getAuth0 } from "../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
export interface ArchivedAnalyticsQuery extends UseQueryOptions<ResponseList<"UserEvaluationCycleDTOs", AnalyticsUserId>> {
|
|
6
|
+
page?: number;
|
|
7
|
+
records?: number;
|
|
8
|
+
pYear?: string;
|
|
9
|
+
userId: string;
|
|
10
|
+
sortBy?: string;
|
|
11
|
+
sortDirection?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const getArchivedAnalyticsQueryHook = ({ page, records, userId, pYear, sortBy, sortDirection }: ArchivedAnalyticsQuery) => {
|
|
15
|
+
return useQuery(
|
|
16
|
+
['ARCHIVED_ANALYTICS_QUERY', page, records, userId, pYear, sortBy, sortDirection],
|
|
17
|
+
() => getAuth0<ResponseList<"UserEvaluationCycleDTOs", AnalyticsUserId>>(`/APE/Analytics/GetArchive/${userId}`, {
|
|
18
|
+
pPage: page || 1,
|
|
19
|
+
pSortBy: sortBy || "Type",
|
|
20
|
+
pSortDirection: sortDirection || "asc",
|
|
21
|
+
pRecords: records || 50,
|
|
22
|
+
pYear: pYear
|
|
23
|
+
}),
|
|
24
|
+
{
|
|
25
|
+
keepPreviousData: true,
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -14,7 +14,7 @@ interface StoreQueryProps extends UseQueryOptions<ResponseList<"Locations", Stor
|
|
|
14
14
|
|
|
15
15
|
export const useAllStoreQuery = ({ records, sortBy, sortDirection, tags, advancedTags, filter, page, ...options }: StoreQueryProps) => {
|
|
16
16
|
const pQueryValue = advancedTags && filter
|
|
17
|
-
? `${advancedTags}
|
|
17
|
+
? `${advancedTags} AND ${filter}`
|
|
18
18
|
: advancedTags
|
|
19
19
|
? advancedTags
|
|
20
20
|
: filter
|
package/src/hooks/index.ts
CHANGED
|
@@ -43,6 +43,7 @@ export * from './Analytics/get/useAnalyticsUserIdQuery.hook';
|
|
|
43
43
|
export * from './Analytics/get/useAnalyticsQuestionsQuery.hook';
|
|
44
44
|
export * from './Analytics/get/useAnalyticsSideBarQuery.hook';
|
|
45
45
|
export * from './Analytics/get/useAnalyticsUserQuery.hook';
|
|
46
|
+
export * from './Analytics/get/getArchivedAnalyticsQuery.hook';
|
|
46
47
|
|
|
47
48
|
//Answers
|
|
48
49
|
export * from './Answer/get/useAnswerIdQuery.hook';
|