@omniumretail/shared-resources 0.1.98 → 0.1.99
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/Answer/others/openAnswerQuery.hook.d.ts +2 -0
- package/dist/types/hooks/Answer/others/showAnswerQuery.hook.d.ts +2 -0
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/interfaces/GetMonths.d.ts +1 -0
- package/package.json +1 -1
- package/src/hooks/Answer/others/openAnswerQuery.hook.ts +19 -0
- package/src/hooks/Answer/others/showAnswerQuery.hook.ts +18 -0
- package/src/hooks/BigWin/others/publishMonthsEmployeeQuery.hook.ts +3 -1
- package/src/hooks/BigWin/others/publishMonthsManagerQuery.hook.ts +3 -1
- package/src/hooks/index.ts +2 -0
- package/src/interfaces/GetMonths.ts +1 -0
|
@@ -38,6 +38,8 @@ export * from './Analytics/get/getArchivedAnalyticsQuery.hook';
|
|
|
38
38
|
export * from './Answer/get/useAnswerIdQuery.hook';
|
|
39
39
|
export * from './Answer/mutate/useAnswerMutateQuery.hook';
|
|
40
40
|
export * from './Answer/get/useAnswersUserSupervisorQuery.hook';
|
|
41
|
+
export * from './Answer/others/openAnswerQuery.hook';
|
|
42
|
+
export * from './Answer/others/showAnswerQuery.hook';
|
|
41
43
|
export * from './AprProduct/get/useProductsQuery.hook';
|
|
42
44
|
export * from './AprProduct/get/useProductHierarchies.hook';
|
|
43
45
|
export * from './AprProduct/get/useProductRecommendations.hook';
|
package/package.json
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { Answer } from '../../../interfaces';
|
|
3
|
+
import { putAuth0 } from '../../../services/ApiService';
|
|
4
|
+
|
|
5
|
+
export const openAnswerQueryHook = () => {
|
|
6
|
+
const queryClient = useQueryClient();
|
|
7
|
+
return useMutation<Answer, unknown, Answer>((data: Answer) => {
|
|
8
|
+
return putAuth0(`/APE/Answers/OpenAnswer?`, {
|
|
9
|
+
pAnswerId: data.Id,
|
|
10
|
+
pUserId: data.UserId,
|
|
11
|
+
pEvaluationCycleId: data.EvaluationCycleId
|
|
12
|
+
}, data);
|
|
13
|
+
}, {
|
|
14
|
+
onSuccess: (data: Answer) => {
|
|
15
|
+
queryClient.setQueryData(
|
|
16
|
+
['OPEN_ANSWER_QUERY'], data);
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { AnalyticsUserId, Answer } from '../../../interfaces';
|
|
3
|
+
import { putAuth0 } from '../../../services/ApiService';
|
|
4
|
+
|
|
5
|
+
export const showAnswerQueryHook = () => {
|
|
6
|
+
const queryClient = useQueryClient();
|
|
7
|
+
return useMutation<Answer, unknown, AnalyticsUserId>((data: AnalyticsUserId) => {
|
|
8
|
+
return putAuth0(`/APE/Answers/ShowAnswers?`, {
|
|
9
|
+
pUserAnswerId: data.UserGrade,
|
|
10
|
+
pSupervisorAnswerId: data.SupervisorGrade
|
|
11
|
+
}, data);
|
|
12
|
+
}, {
|
|
13
|
+
onSuccess: (data: Answer) => {
|
|
14
|
+
queryClient.setQueryData(
|
|
15
|
+
['SHOW_ANSWER_QUERY'], data);
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
}
|
|
@@ -6,7 +6,9 @@ export const publishMonthsEmployeeHook = () => {
|
|
|
6
6
|
const queryClient = useQueryClient();
|
|
7
7
|
return useMutation<number, unknown, GetMonths>((data: GetMonths) => {
|
|
8
8
|
return postAuth0(`/ABWG/BWGEmployees?`, {
|
|
9
|
-
pMonth: data.MonthCode
|
|
9
|
+
pMonth: data.MonthCode,
|
|
10
|
+
pUserId: data.UserId,
|
|
11
|
+
pYear: data.Year
|
|
10
12
|
}, data);
|
|
11
13
|
}, {
|
|
12
14
|
onSuccess: (data: number) => {
|
|
@@ -6,7 +6,9 @@ export const publishMonthsManagerHook = () => {
|
|
|
6
6
|
const queryClient = useQueryClient();
|
|
7
7
|
return useMutation<number, unknown, GetMonths>((data: GetMonths) => {
|
|
8
8
|
return postAuth0(`/ABWG/BWGManager?`, {
|
|
9
|
-
pMonth: data.MonthCode
|
|
9
|
+
pMonth: data.MonthCode,
|
|
10
|
+
pUserId: data.UserId,
|
|
11
|
+
pYear: data.Year
|
|
10
12
|
}, data);
|
|
11
13
|
}, {
|
|
12
14
|
onSuccess: (data: number) => {
|
package/src/hooks/index.ts
CHANGED
|
@@ -49,6 +49,8 @@ export * from './Analytics/get/getArchivedAnalyticsQuery.hook';
|
|
|
49
49
|
export * from './Answer/get/useAnswerIdQuery.hook';
|
|
50
50
|
export * from './Answer/mutate/useAnswerMutateQuery.hook';
|
|
51
51
|
export * from './Answer/get/useAnswersUserSupervisorQuery.hook';
|
|
52
|
+
export * from './Answer/others/openAnswerQuery.hook';
|
|
53
|
+
export * from './Answer/others/showAnswerQuery.hook';
|
|
52
54
|
|
|
53
55
|
//AprProducts
|
|
54
56
|
export * from './AprProduct/get/useProductsQuery.hook';
|