@omniumretail/shared-resources 0.1.96 → 0.1.98
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Answer } from '../../../../interfaces';
|
|
2
|
-
export declare const useAstaAnswersMutateHook: (inspectionId: string) => import("@tanstack/react-query").UseMutationResult<Answer, unknown, Answer, unknown>;
|
|
2
|
+
export declare const useAstaAnswersMutateHook: (inspectionId: string, answerId: string) => import("@tanstack/react-query").UseMutationResult<Answer, unknown, Answer, unknown>;
|
package/package.json
CHANGED
|
@@ -2,11 +2,11 @@ import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
|
2
2
|
import { Answer } from '../../../../interfaces';
|
|
3
3
|
import { putAuth0, postAuth0 } from '../../../../services/ApiService';
|
|
4
4
|
|
|
5
|
-
export const useAstaAnswersMutateHook = (inspectionId: string) => {
|
|
5
|
+
export const useAstaAnswersMutateHook = (inspectionId: string, answerId: string) => {
|
|
6
6
|
const queryClient = useQueryClient();
|
|
7
7
|
return useMutation<Answer, unknown, Answer>((data: Answer) => {
|
|
8
|
-
return
|
|
9
|
-
putAuth0(`/ASTA/Answers/${
|
|
8
|
+
return inspectionId === "" ?
|
|
9
|
+
putAuth0(`/ASTA/Answers/${answerId}`, undefined, data)
|
|
10
10
|
|
|
11
11
|
: postAuth0(`/ASTA/Answers?`, {
|
|
12
12
|
pInspectionId: inspectionId
|