@omniumretail/shared-resources 0.2.72 → 0.2.73
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/Answer/others/sendInspectionEmailQuery.hook.d.ts +2 -0
- package/dist/types/hooks/Asta/Inspection/others/exportInspectionQuery.hook.d.ts +2 -0
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/interfaces/Inspection.d.ts +1 -0
- package/package.json +1 -1
- package/src/hooks/Asta/Answer/others/sendInspectionEmailQuery.hook.ts +21 -0
- package/src/hooks/Asta/Inspection/others/exportInspectionQuery.hook.ts +19 -0
- package/src/hooks/index.ts +2 -0
- package/src/interfaces/Inspection.ts +1 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Inspection } from '../../../../interfaces';
|
|
2
|
+
export declare const sendInspectionEmailMutateHook: (answerId: string, userName: string, email: string, storeId: string, pdfUrl: string) => import("@tanstack/react-query").UseMutationResult<Inspection, unknown, Inspection, unknown>;
|
|
@@ -177,6 +177,7 @@ export * from "./Asta/Inspection/others/deleteInspectionQuery.hook";
|
|
|
177
177
|
export * from "./Asta/Inspection/others/finishInspectionQuery.hook";
|
|
178
178
|
export * from "./Asta/Inspection/others/archiveTemplateQuery.hook";
|
|
179
179
|
export * from "./Asta/Inspection/others/extractTemplateQuery.hook";
|
|
180
|
+
export * from "./Asta/Inspection/others/exportInspectionQuery.hook";
|
|
180
181
|
export * from "./Asta/Answer/get/getAstaAnswerQuery.hook";
|
|
181
182
|
export * from "./Asta/Answer/get/getAstaAnswerByIdQuery.hook";
|
|
182
183
|
export * from "./Asta/Answer/mutate/useAstaAnswersMutateQuery.hook";
|
|
@@ -187,6 +188,7 @@ export * from "./Asta/Answer/get/getAstaAnswerByIdQuery.hook";
|
|
|
187
188
|
export * from "./Asta/Answer/mutate/useAstaAnswersMutateQuery.hook";
|
|
188
189
|
export * from "./Asta/Answer/others/finishAstaAnswersQuery.hook";
|
|
189
190
|
export * from "./Asta/Answer/others/putAnswerImageQuery.hook";
|
|
191
|
+
export * from "./Asta/Answer/others/sendInspectionEmailQuery.hook";
|
|
190
192
|
export * from "./Asta/AnswerType/get/getAnswerTypeQuery.hook";
|
|
191
193
|
export * from "./Asta/AnswerType/get/getAllAnswerTypeQuery.hook";
|
|
192
194
|
export * from "./Asta/AnswerType/get/getAnswerColorsQuery.hook";
|
package/package.json
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { Inspection } from '../../../../interfaces';
|
|
3
|
+
import { postAuth0 } from '../../../../services/ApiService';
|
|
4
|
+
|
|
5
|
+
export const sendInspectionEmailMutateHook = (answerId: string, userName: string, email: string, storeId: string, pdfUrl: string) => {
|
|
6
|
+
const queryClient = useQueryClient();
|
|
7
|
+
return useMutation<Inspection, unknown, Inspection>((data: Inspection) => {
|
|
8
|
+
return postAuth0(`/ASTA/Answers/SendEmail?`, {
|
|
9
|
+
pAnswerId: answerId,
|
|
10
|
+
pUserName: userName,
|
|
11
|
+
pEmail: email,
|
|
12
|
+
pStoreId: storeId,
|
|
13
|
+
pPDFUrl: pdfUrl
|
|
14
|
+
}, data);
|
|
15
|
+
}, {
|
|
16
|
+
onSuccess: (data: Inspection) => {
|
|
17
|
+
queryClient.setQueryData(
|
|
18
|
+
['SEND_INSPECTION_EMAIL_QUERY'], data);
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { Inspection } from '../../../../interfaces';
|
|
3
|
+
import { postAuth0 } from '../../../../services/ApiService';
|
|
4
|
+
|
|
5
|
+
export const exportInspectionMutateHook = (inspectionId: string, userName: string, language?: string) => {
|
|
6
|
+
const queryClient = useQueryClient();
|
|
7
|
+
return useMutation<Inspection, unknown, Inspection>((data: Inspection) => {
|
|
8
|
+
return postAuth0(`/ASTA/Inspection/AnswerExport?`, {
|
|
9
|
+
pInspectionId: inspectionId,
|
|
10
|
+
pUserName: userName,
|
|
11
|
+
pLanguage: language || "PT"
|
|
12
|
+
}, data);
|
|
13
|
+
}, {
|
|
14
|
+
onSuccess: (data: Inspection) => {
|
|
15
|
+
queryClient.setQueryData(
|
|
16
|
+
['EXPORT_INSPECTION_QUERY'], data);
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
}
|
package/src/hooks/index.ts
CHANGED
|
@@ -209,6 +209,7 @@ export * from "./Asta/Inspection/others/deleteInspectionQuery.hook";
|
|
|
209
209
|
export * from "./Asta/Inspection/others/finishInspectionQuery.hook";
|
|
210
210
|
export * from "./Asta/Inspection/others/archiveTemplateQuery.hook";
|
|
211
211
|
export * from "./Asta/Inspection/others/extractTemplateQuery.hook";
|
|
212
|
+
export * from "./Asta/Inspection/others/exportInspectionQuery.hook";
|
|
212
213
|
|
|
213
214
|
export * from "./Asta/Answer/get/getAstaAnswerQuery.hook";
|
|
214
215
|
export * from "./Asta/Answer/get/getAstaAnswerByIdQuery.hook";
|
|
@@ -220,6 +221,7 @@ export * from "./Asta/Answer/get/getAstaAnswerByIdQuery.hook";
|
|
|
220
221
|
export * from "./Asta/Answer/mutate/useAstaAnswersMutateQuery.hook";
|
|
221
222
|
export * from "./Asta/Answer/others/finishAstaAnswersQuery.hook";
|
|
222
223
|
export * from "./Asta/Answer/others/putAnswerImageQuery.hook";
|
|
224
|
+
export * from "./Asta/Answer/others/sendInspectionEmailQuery.hook";
|
|
223
225
|
|
|
224
226
|
export * from "./Asta/AnswerType/get/getAnswerTypeQuery.hook";
|
|
225
227
|
export * from "./Asta/AnswerType/get/getAllAnswerTypeQuery.hook";
|