@omniumretail/shared-resources 0.1.75 → 0.1.77

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: (inpsectionId: string) => import("@tanstack/react-query").UseMutationResult<Answer, unknown, Answer, unknown>;
2
+ export declare const useAstaAnswersMutateHook: (inspectionId: string) => import("@tanstack/react-query").UseMutationResult<Answer, unknown, Answer, unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.1.75",
3
+ "version": "0.1.77",
4
4
  "private": false,
5
5
  "description": "Shared Components and services or utils to the frontend versions",
6
6
  "main": "dist/bundle.js",
@@ -2,12 +2,15 @@ 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 = (inpsectionId: string) => {
5
+ export const useAstaAnswersMutateHook = (inspectionId: string) => {
6
6
  const queryClient = useQueryClient();
7
7
  return useMutation<Answer, unknown, Answer>((data: Answer) => {
8
8
  return data.Id ?
9
- putAuth0(`/ASTA/Answers/${data.Id}`, undefined, data) :
10
- postAuth0(`/ASTA/Answers?pInspectionId=${inpsectionId}`, undefined, data);
9
+ putAuth0(`/ASTA/Answers/${data.Id}`, undefined, data)
10
+
11
+ : postAuth0(`/ASTA/Answers`, {
12
+ pInspectionId: inspectionId
13
+ }, data);
11
14
  }, {
12
15
  onSuccess: (data: Answer) => {
13
16
  queryClient.setQueryData(
@@ -6,8 +6,13 @@ export const useInspectionMutateHook = (templateId: string) => {
6
6
  const queryClient = useQueryClient();
7
7
  return useMutation<Inspection, unknown, Inspection>((data: Inspection) => {
8
8
  return data.Id ?
9
- putAuth0(`/ASTA/Inspection/FileInspection?pId=${data.Id}`, undefined, data) :
10
- postAuth0(`/ASTA/Inspection?pId=${templateId}`, undefined, data);
9
+ putAuth0(`/ASTA/Inspection/FileInspection}`, {
10
+ pId: data.Id
11
+ }, data) :
12
+
13
+ postAuth0(`/ASTA/Inspection`, {
14
+ pId: templateId
15
+ } , data);
11
16
  }, {
12
17
  onSuccess: (data: Inspection) => {
13
18
  queryClient.setQueryData(
@@ -5,7 +5,9 @@ import { putAuth0 } from '../../../../services/ApiService';
5
5
  export const finishInspectionQueryHook = () => {
6
6
  const queryClient = useQueryClient();
7
7
  return useMutation<Inspection, unknown, Inspection>((data: Inspection) => {
8
- return putAuth0(`/ASTA/Inspection/FinishInspection?pId=${data.Id}`, undefined, data)
8
+ return putAuth0(`/ASTA/Inspection/FinishInspection`, {
9
+ pId: data.Id
10
+ }, data)
9
11
  }, {
10
12
  onSuccess: (data: Inspection) => {
11
13
  queryClient.setQueryData(
@@ -5,7 +5,9 @@ import { getAuth0 } from "../../../../services/ApiService";
5
5
  export const getTemplateByIdQueryHook = (templateId: string) => {
6
6
  return useQuery(
7
7
  ['TEMPLATE_ID_QUERY', templateId],
8
- () => getAuth0<Template>(`/ASTA/Template/GetById?pId=${templateId}`),
8
+ () => getAuth0<Template>(`/ASTA/Template/GetById`, {
9
+ pId: templateId
10
+ }),
9
11
  {
10
12
  enabled: !!(templateId),
11
13
  },
@@ -6,8 +6,11 @@ export const useTemplateMutateHook = () => {
6
6
  const queryClient = useQueryClient();
7
7
  return useMutation<Template, unknown, Template>((data: Template) => {
8
8
  return data.Id ?
9
- putAuth0(`/ASTA/Template/FileTemplate?pId=${data.Id}`, undefined, data) :
10
- postAuth0('/ASTA/Template', undefined, data);
9
+ putAuth0(`/ASTA/Template/FileTemplate`, {
10
+ pId: data.Id
11
+ }, data)
12
+
13
+ : postAuth0('/ASTA/Template', undefined, data);
11
14
  }, {
12
15
  onSuccess: (data: Template) => {
13
16
  queryClient.setQueryData(
@@ -5,7 +5,9 @@ import { putAuth0 } from '../../../../services/ApiService';
5
5
  export const finishTemplateQueryHook = () => {
6
6
  const queryClient = useQueryClient();
7
7
  return useMutation<Template, unknown, Template>((data: Template) => {
8
- return putAuth0(`/ASTA/Template/FinishTemplate?pId=${data.Id}`, undefined, data)
8
+ return putAuth0(`/ASTA/Template/FinishTemplate`, {
9
+ pId: data.Id
10
+ }, data);
9
11
  }, {
10
12
  onSuccess: (data: Template) => {
11
13
  queryClient.setQueryData(
@@ -16,9 +16,13 @@ export interface Template {
16
16
  }
17
17
 
18
18
  export interface AstaCategories {
19
- Name: string;
20
- Questions: AstaQuestions[];
21
- SubCategoriesDTO: AstaCategories[];
19
+ Title: string;
20
+ Key: string;
21
+ Data: {
22
+ Name: string;
23
+ Questions: AstaQuestions[];
24
+ };
25
+ Children: AstaCategories[];
22
26
  }
23
27
 
24
28
  export interface HeadersInterface {