@omniumretail/shared-resources 0.1.74 → 0.1.75
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/Asta/Template/mutate/useTemplateMutateQuery.hook.d.ts +2 -0
- package/dist/types/hooks/Asta/Template/others/extractTemplateQuery.hook.d.ts +6 -0
- package/dist/types/hooks/Asta/Template/others/finishTemplateQuery.hook.d.ts +2 -6
- package/dist/types/hooks/index.d.ts +3 -2
- package/package.json +1 -1
- package/src/hooks/Asta/Template/others/extractTemplateQuery.hook.ts +19 -0
- package/src/hooks/Asta/Template/others/finishTemplateQuery.hook.ts +5 -9
- package/src/hooks/index.ts +3 -2
- /package/src/hooks/Asta/Template/mutate/{useEvaluationCycleMutateQuery.hook.ts → useTemplateMutateQuery.hook.ts} +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import { Template } from '../../../../interfaces';
|
|
3
|
+
export interface ExtractTemplateProps extends UseQueryOptions<Template> {
|
|
4
|
+
templatesIds: string[];
|
|
5
|
+
}
|
|
6
|
+
export declare const extractTemplateQueryHook: ({ templatesIds }: ExtractTemplateProps) => import("@tanstack/react-query").UseMutationResult<Template, unknown, string[], unknown>;
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export interface FinishTemplateProps extends UseQueryOptions<Template> {
|
|
4
|
-
templatesIds: string[];
|
|
5
|
-
}
|
|
6
|
-
export declare const finishTemplateQueryHook: ({ templatesIds }: FinishTemplateProps) => import("@tanstack/react-query").UseMutationResult<Template, unknown, string[], unknown>;
|
|
1
|
+
import { Template } from '../../../../interfaces/Template';
|
|
2
|
+
export declare const finishTemplateQueryHook: () => import("@tanstack/react-query").UseMutationResult<Template, unknown, Template, unknown>;
|
|
@@ -63,11 +63,12 @@ export * from './ATIM/PicaPonto/mutate/postAttendance.hook';
|
|
|
63
63
|
export * from './Asta/Template/get/getTemplateByIdQuery.hook';
|
|
64
64
|
export * from './Asta/Template/get/getTemplateHeadersQuery.hook';
|
|
65
65
|
export * from './Asta/Template/get/getTemplateQuery.hook';
|
|
66
|
-
export * from './Asta/Template/mutate/
|
|
66
|
+
export * from './Asta/Template/mutate/useTemplateMutateQuery.hook';
|
|
67
67
|
export * from './Asta/Template/others/deleteTemplateQuery.hook';
|
|
68
|
-
export * from './Asta/Template/others/
|
|
68
|
+
export * from './Asta/Template/others/extractTemplateQuery.hook';
|
|
69
69
|
export * from './Asta/Template/others/archiveTemplateQuery.hook';
|
|
70
70
|
export * from './Asta/Template/others/duplicateTemplateQuery.hook';
|
|
71
|
+
export * from './Asta/Template/others/finishTemplateQuery.hook';
|
|
71
72
|
export * from './Asta/Inspection/get/getInspectionQuery.hook';
|
|
72
73
|
export * from './Asta/Inspection/mutate/useInspectionMutateQuery.hook';
|
|
73
74
|
export * from './Asta/Inspection/others/deleteInspectionQuery.hook';
|
package/package.json
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { UseQueryOptions, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { Template } from '../../../../interfaces';
|
|
3
|
+
import { putAuth0 } from '../../../../services/ApiService';
|
|
4
|
+
|
|
5
|
+
export interface ExtractTemplateProps extends UseQueryOptions<Template> {
|
|
6
|
+
templatesIds: string[];
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const extractTemplateQueryHook = ({ templatesIds }: ExtractTemplateProps) => {
|
|
10
|
+
const queryClient = useQueryClient();
|
|
11
|
+
return useMutation<Template, unknown, string[]>(() => {
|
|
12
|
+
return putAuth0(`/ASTA/Template/FinishedTemplateList`, undefined, templatesIds)
|
|
13
|
+
}, {
|
|
14
|
+
onSuccess: (data: Template) => {
|
|
15
|
+
queryClient.setQueryData(
|
|
16
|
+
['TEMPLATE_ID_QUERY'], data);
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Template } from '../../../../interfaces';
|
|
1
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { Template } from '../../../../interfaces/Template';
|
|
3
3
|
import { putAuth0 } from '../../../../services/ApiService';
|
|
4
4
|
|
|
5
|
-
export
|
|
6
|
-
templatesIds: string[];
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const finishTemplateQueryHook = ({ templatesIds }: FinishTemplateProps) => {
|
|
5
|
+
export const finishTemplateQueryHook = () => {
|
|
10
6
|
const queryClient = useQueryClient();
|
|
11
|
-
return useMutation<Template, unknown,
|
|
12
|
-
return putAuth0(`/ASTA/Template/
|
|
7
|
+
return useMutation<Template, unknown, Template>((data: Template) => {
|
|
8
|
+
return putAuth0(`/ASTA/Template/FinishTemplate?pId=${data.Id}`, undefined, data)
|
|
13
9
|
}, {
|
|
14
10
|
onSuccess: (data: Template) => {
|
|
15
11
|
queryClient.setQueryData(
|
package/src/hooks/index.ts
CHANGED
|
@@ -86,11 +86,12 @@ export * from './ATIM/PicaPonto/mutate/postAttendance.hook';
|
|
|
86
86
|
export * from './Asta/Template/get/getTemplateByIdQuery.hook';
|
|
87
87
|
export * from './Asta/Template/get/getTemplateHeadersQuery.hook';
|
|
88
88
|
export * from './Asta/Template/get/getTemplateQuery.hook';
|
|
89
|
-
export * from './Asta/Template/mutate/
|
|
89
|
+
export * from './Asta/Template/mutate/useTemplateMutateQuery.hook';
|
|
90
90
|
export * from './Asta/Template/others/deleteTemplateQuery.hook';
|
|
91
|
-
export * from './Asta/Template/others/
|
|
91
|
+
export * from './Asta/Template/others/extractTemplateQuery.hook';
|
|
92
92
|
export * from './Asta/Template/others/archiveTemplateQuery.hook';
|
|
93
93
|
export * from './Asta/Template/others/duplicateTemplateQuery.hook';
|
|
94
|
+
export * from './Asta/Template/others/finishTemplateQuery.hook';
|
|
94
95
|
|
|
95
96
|
export * from './Asta/Inspection/get/getInspectionQuery.hook';
|
|
96
97
|
export * from './Asta/Inspection/mutate/useInspectionMutateQuery.hook';
|
|
File without changes
|