@omniumretail/shared-resources 0.2.59 → 0.2.61
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/Answer/others/postAnswersExportQuery.hook.d.ts +1 -1
- package/dist/types/hooks/WidgetPicaPonto/get/getCriticaliesQuery.hook.d.ts +11 -0
- package/dist/types/hooks/WidgetPicaPonto/get/getReasonCodesQuery.hook.d.ts +11 -0
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/interfaces/ReasonCodes.d.ts +8 -0
- package/dist/types/interfaces/ResponseList.d.ts +1 -0
- package/dist/types/interfaces/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/hooks/Answer/others/postAnswersExportQuery.hook.ts +16 -11
- package/src/hooks/WidgetPicaPonto/get/getCriticaliesQuery.hook.ts +27 -0
- package/src/hooks/WidgetPicaPonto/get/getReasonCodesQuery.hook.ts +27 -0
- package/src/hooks/index.ts +2 -0
- package/src/interfaces/ReasonCodes.ts +9 -0
- package/src/interfaces/ResponseList.ts +1 -0
- package/src/interfaces/index.ts +1 -0
|
@@ -5,4 +5,4 @@ export interface postAnswersExportQuery extends UseQueryOptions<ReportBuilder> {
|
|
|
5
5
|
userId: string;
|
|
6
6
|
language?: string;
|
|
7
7
|
}
|
|
8
|
-
export declare const postAnswersExportQueryHook: (
|
|
8
|
+
export declare const postAnswersExportQueryHook: () => import("@tanstack/react-query").UseMutationResult<postAnswersExportQuery, unknown, postAnswersExportQuery, unknown>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { ReasonCodes, ResponseList } from "../../../interfaces";
|
|
3
|
+
export interface CriticalitiesQueryProps extends UseQueryOptions<ResponseList<"Criticalities", ReasonCodes>> {
|
|
4
|
+
tags?: string;
|
|
5
|
+
page?: number;
|
|
6
|
+
records?: number;
|
|
7
|
+
sortBy?: string;
|
|
8
|
+
sortDirection?: string;
|
|
9
|
+
query?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const getCriticalitiesQuery: ({ tags, page, records, sortBy, sortDirection, query, ...options }: CriticalitiesQueryProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Criticalities", ReasonCodes>, unknown>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { ReasonCodes, ResponseList } from "../../../interfaces";
|
|
3
|
+
export interface ReasonCodesQueryProps extends UseQueryOptions<ResponseList<"ReasonCodes", ReasonCodes>> {
|
|
4
|
+
tags?: string;
|
|
5
|
+
page?: number;
|
|
6
|
+
records?: number;
|
|
7
|
+
sortBy?: string;
|
|
8
|
+
sortDirection?: string;
|
|
9
|
+
query?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const getReasonCodesQuery: ({ tags, page, records, sortBy, sortDirection, query, ...options }: ReasonCodesQueryProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"ReasonCodes", ReasonCodes>, unknown>;
|
|
@@ -143,6 +143,8 @@ export * from "./ATIM/PicaPonto/mutate/postAttendance.hook";
|
|
|
143
143
|
export * from "./WidgetPicaPonto/get/getAttendanceIssuesByIdQuery.hook";
|
|
144
144
|
export * from "./WidgetPicaPonto/get/getAttendanceIssuesQuery.hook";
|
|
145
145
|
export * from "./WidgetPicaPonto/others/postAttendanceIssuesQuery.hook";
|
|
146
|
+
export * from "./WidgetPicaPonto/get/getCriticaliesQuery.hook";
|
|
147
|
+
export * from "./WidgetPicaPonto/get/getReasonCodesQuery.hook";
|
|
146
148
|
export * from "./Asta/Template/get/getTemplateByIdQuery.hook";
|
|
147
149
|
export * from "./Asta/Template/get/getTemplateHeadersQuery.hook";
|
|
148
150
|
export * from "./Asta/Template/get/getTemplateQuery.hook";
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
1
|
+
import { useMutation, useQuery, useQueryClient, UseQueryOptions } from "@tanstack/react-query";
|
|
2
2
|
import { ReportBuilder } from "../../../interfaces";
|
|
3
3
|
import { postAuth0 } from "../../../services/ApiService";
|
|
4
4
|
|
|
@@ -8,14 +8,19 @@ export interface postAnswersExportQuery extends UseQueryOptions<ReportBuilder> {
|
|
|
8
8
|
language?: string;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export const postAnswersExportQueryHook = (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
pEvaluationCycleId: evaluationId,
|
|
16
|
-
pLanguage: language || "PT",
|
|
17
|
-
pUserId: userId
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
export const postAnswersExportQueryHook = () => {
|
|
12
|
+
const queryClient = useQueryClient();
|
|
13
|
+
return useMutation<postAnswersExportQuery, unknown, postAnswersExportQuery>((data: postAnswersExportQuery) => {
|
|
14
|
+
return postAuth0(`/APE/EvaluationCycle/AnswerExport?`, {
|
|
15
|
+
pEvaluationCycleId: data.evaluationId,
|
|
16
|
+
pLanguage: data.language || "PT",
|
|
17
|
+
pUserId: data.userId
|
|
18
|
+
}, data);
|
|
19
|
+
}, {
|
|
20
|
+
onSuccess: (data: postAnswersExportQuery) => {
|
|
21
|
+
queryClient.setQueryData(
|
|
22
|
+
['POST_ANSWERS_EXPORT'], data);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
21
25
|
}
|
|
26
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { ReasonCodes, ResponseList } from "../../../interfaces";
|
|
3
|
+
import { getAuth0 } from "../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
export interface CriticalitiesQueryProps extends UseQueryOptions<ResponseList<"Criticalities", ReasonCodes>> {
|
|
6
|
+
tags?: string;
|
|
7
|
+
page?: number;
|
|
8
|
+
records?: number;
|
|
9
|
+
sortBy?: string;
|
|
10
|
+
sortDirection?: string;
|
|
11
|
+
query?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const getCriticalitiesQuery = ({ tags, page, records, sortBy, sortDirection, query, ...options }: CriticalitiesQueryProps) => {
|
|
15
|
+
return useQuery(
|
|
16
|
+
['CRITICALITIES_QUERY', tags, page, records, sortBy, sortDirection, query, options],
|
|
17
|
+
() => getAuth0<ResponseList<"Criticalities", ReasonCodes>>('/ATIM/Criticalities', {
|
|
18
|
+
pPage: page || 1,
|
|
19
|
+
pRecords: records || 50,
|
|
20
|
+
pSortBy: sortBy || 'Value',
|
|
21
|
+
pSortDirection: sortDirection || 'asc',
|
|
22
|
+
pTerms: tags,
|
|
23
|
+
pQuery: query,
|
|
24
|
+
}),
|
|
25
|
+
options
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { ReasonCodes, ResponseList } from "../../../interfaces";
|
|
3
|
+
import { getAuth0 } from "../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
export interface ReasonCodesQueryProps extends UseQueryOptions<ResponseList<"ReasonCodes", ReasonCodes>> {
|
|
6
|
+
tags?: string;
|
|
7
|
+
page?: number;
|
|
8
|
+
records?: number;
|
|
9
|
+
sortBy?: string;
|
|
10
|
+
sortDirection?: string;
|
|
11
|
+
query?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const getReasonCodesQuery = ({ tags, page, records, sortBy, sortDirection, query, ...options }: ReasonCodesQueryProps) => {
|
|
15
|
+
return useQuery(
|
|
16
|
+
['REASON_CODES_QUERY', tags, page, records, sortBy, sortDirection, query, options],
|
|
17
|
+
() => getAuth0<ResponseList<"ReasonCodes", ReasonCodes>>('/ATIM/ReasonCodes', {
|
|
18
|
+
pPage: page || 1,
|
|
19
|
+
pRecords: records || 50,
|
|
20
|
+
pSortBy: sortBy || 'Name',
|
|
21
|
+
pSortDirection: sortDirection || 'asc',
|
|
22
|
+
pTerms: tags,
|
|
23
|
+
pQuery: query,
|
|
24
|
+
}),
|
|
25
|
+
options
|
|
26
|
+
);
|
|
27
|
+
}
|
package/src/hooks/index.ts
CHANGED
|
@@ -172,6 +172,8 @@ export * from "./ATIM/PicaPonto/mutate/postAttendance.hook";
|
|
|
172
172
|
export * from "./WidgetPicaPonto/get/getAttendanceIssuesByIdQuery.hook";
|
|
173
173
|
export * from "./WidgetPicaPonto/get/getAttendanceIssuesQuery.hook";
|
|
174
174
|
export * from "./WidgetPicaPonto/others/postAttendanceIssuesQuery.hook";
|
|
175
|
+
export * from "./WidgetPicaPonto/get/getCriticaliesQuery.hook";
|
|
176
|
+
export * from "./WidgetPicaPonto/get/getReasonCodesQuery.hook";
|
|
175
177
|
|
|
176
178
|
//ASTA
|
|
177
179
|
export * from "./Asta/Template/get/getTemplateByIdQuery.hook";
|
package/src/interfaces/index.ts
CHANGED