@omniumretail/shared-resources 0.1.66 → 0.1.67

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 { AnswerType } from "../../../../interfaces";
2
+ export declare const getAnswerTypeQueryHook: () => import("@tanstack/react-query").UseQueryResult<AnswerType[], unknown>;
@@ -75,6 +75,7 @@ export * from './Asta/Answer/get/getAstaAnswerQuery.hook';
75
75
  export * from './Asta/Answer/mutate/useAstaAnswersMutateQuery.hook';
76
76
  export * from './Asta/Answer/others/finishAstaAnswersQuery.hook';
77
77
  export * from './Asta/Answer/others/putAnswerImageQuery.hook';
78
+ export * from './Asta/AnswerType/get/getAnswerTypeQuery.hook';
78
79
  export * from './Others/useJobTitlesQuery.hook';
79
80
  export * from './Others/useContractStatesQuery.hook';
80
81
  export * from './Others/useApplicationDataQuery.hook';
@@ -0,0 +1,17 @@
1
+ export interface AnswerType {
2
+ Id: string;
3
+ Name: string;
4
+ IsOpenAnswer: boolean;
5
+ IsCheckBox: boolean;
6
+ IsNumeric: boolean;
7
+ HasGrade: boolean;
8
+ State: string;
9
+ Grade: number;
10
+ Options: AnswerTypeOptions[];
11
+ }
12
+ export interface AnswerTypeOptions {
13
+ Value: string;
14
+ Grade: number;
15
+ Color: string;
16
+ NeedsAction: boolean;
17
+ }
@@ -45,3 +45,4 @@ export * from './Inspection';
45
45
  export * from './Responses';
46
46
  export * from './TimeKeeping';
47
47
  export * from './Employee';
48
+ export * from './AnswerType';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.1.66",
3
+ "version": "0.1.67",
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,10 @@
1
+ import { useQuery } from "@tanstack/react-query";
2
+ import { AnswerType } from "../../../../interfaces";
3
+ import { getAuth0 } from "../../../../services/ApiService";
4
+
5
+ export const getAnswerTypeQueryHook = () => {
6
+ return useQuery(
7
+ ['ANSWER_TYPE_QUERY'],
8
+ () => getAuth0<AnswerType[]>(`/ASTA/AnswerType`),
9
+ );
10
+ }
@@ -1,6 +1,6 @@
1
1
  import { UseQueryOptions, useMutation, useQueryClient } from '@tanstack/react-query';
2
2
  import { Template } from '../../../../interfaces';
3
- import { putAuth0 } from '../../../../services/ApiService';
3
+ import { postAuth0 } from '../../../../services/ApiService';
4
4
 
5
5
  export interface DuplicateTemplateProps extends UseQueryOptions<Template> {
6
6
  templatesIds: string[];
@@ -9,7 +9,7 @@ export interface DuplicateTemplateProps extends UseQueryOptions<Template> {
9
9
  export const duplicateTemplateQueryHook = ({ templatesIds }: DuplicateTemplateProps) => {
10
10
  const queryClient = useQueryClient();
11
11
  return useMutation<Template, unknown, string[]>(() => {
12
- return putAuth0(`/ASTA/Template/DuplicateTemplateList`, undefined, templatesIds)
12
+ return postAuth0(`/ASTA/Template/DuplicateTemplateList`, undefined, templatesIds)
13
13
  }, {
14
14
  onSuccess: (data: Template) => {
15
15
  queryClient.setQueryData(
@@ -101,6 +101,8 @@ export * from './Asta/Answer/mutate/useAstaAnswersMutateQuery.hook';
101
101
  export * from './Asta/Answer/others/finishAstaAnswersQuery.hook';
102
102
  export * from './Asta/Answer/others/putAnswerImageQuery.hook';
103
103
 
104
+ export * from './Asta/AnswerType/get/getAnswerTypeQuery.hook';
105
+
104
106
  //Others
105
107
  export * from './Others/useJobTitlesQuery.hook';
106
108
  export * from './Others/useContractStatesQuery.hook';
@@ -0,0 +1,19 @@
1
+
2
+ export interface AnswerType {
3
+ Id: string;
4
+ Name: string;
5
+ IsOpenAnswer: boolean;
6
+ IsCheckBox: boolean;
7
+ IsNumeric: boolean;
8
+ HasGrade: boolean;
9
+ State: string;
10
+ Grade: number;
11
+ Options: AnswerTypeOptions[];
12
+ }
13
+
14
+ export interface AnswerTypeOptions {
15
+ Value: string;
16
+ Grade: number;
17
+ Color: string;
18
+ NeedsAction: boolean
19
+ }
@@ -45,3 +45,4 @@ export * from './Inspection';
45
45
  export * from './Responses';
46
46
  export * from './TimeKeeping';
47
47
  export * from './Employee';
48
+ export * from './AnswerType';