@omniumretail/shared-resources 0.3.5 → 0.3.6

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.
@@ -0,0 +1,2 @@
1
+ import { Inspection } from '../../../../interfaces';
2
+ export declare const sendInspectionEmailStoreMutateHook: (answerId: string, userName: string, storeId: string, pdfUrl: string) => import("@tanstack/react-query").UseMutationResult<Inspection, unknown, Inspection, unknown>;
@@ -218,6 +218,7 @@ export * from "./Asta/Answer/others/finishAstaAnswersQuery.hook";
218
218
  export * from "./Asta/Answer/others/putAnswerImageQuery.hook";
219
219
  export * from "./Asta/Answer/others/sendInspectionEmailQuery.hook";
220
220
  export * from "./Asta/Answer/others/finishGNGAstaAnswersQuery.hook";
221
+ export * from "./Asta/Answer/others/sendInspectionEmailStoreQuery.hook";
221
222
  export * from "./Asta/AnswerType/get/getAnswerTypeQuery.hook";
222
223
  export * from "./Asta/AnswerType/get/getAllAnswerTypeQuery.hook";
223
224
  export * from "./Asta/AnswerType/get/getAnswerColorsQuery.hook";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.3.05",
3
+ "version": "0.3.06",
4
4
  "private": false,
5
5
  "description": "Shared Components and services or utils to the frontend versions",
6
6
  "main": "dist/bundle.js",
@@ -0,0 +1,20 @@
1
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
2
+ import { Inspection } from '../../../../interfaces';
3
+ import { putAuth0 } from '../../../../services/ApiService';
4
+
5
+ export const sendInspectionEmailStoreMutateHook = (answerId: string, userName: string, storeId: string, pdfUrl: string) => {
6
+ const queryClient = useQueryClient();
7
+ return useMutation<Inspection, unknown, Inspection>((data: Inspection) => {
8
+ return putAuth0(`/ASTA/Answers/SendEmailStore?`, {
9
+ pAnswerId: answerId,
10
+ pUserName: userName,
11
+ pStoreId: storeId,
12
+ pPDFUrl: pdfUrl
13
+ }, data);
14
+ }, {
15
+ onSuccess: (data: Inspection) => {
16
+ queryClient.setQueryData(
17
+ ['SEND_INSPECTION_EMAIL_STORE_QUERY'], data);
18
+ },
19
+ });
20
+ }
@@ -253,6 +253,7 @@ export * from "./Asta/Answer/others/finishAstaAnswersQuery.hook";
253
253
  export * from "./Asta/Answer/others/putAnswerImageQuery.hook";
254
254
  export * from "./Asta/Answer/others/sendInspectionEmailQuery.hook";
255
255
  export * from "./Asta/Answer/others/finishGNGAstaAnswersQuery.hook";
256
+ export * from "./Asta/Answer/others/sendInspectionEmailStoreQuery.hook";
256
257
 
257
258
  export * from "./Asta/AnswerType/get/getAnswerTypeQuery.hook";
258
259
  export * from "./Asta/AnswerType/get/getAllAnswerTypeQuery.hook";