@omniumretail/shared-resources 0.1.91 → 0.1.93
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/Aprc/get/getPriceChangePinQuery.hook.d.ts +5 -0
- package/dist/types/hooks/Aprc/others/postPriceChangePinQuery.hook.d.ts +6 -0
- package/dist/types/hooks/Aprc/others/sendEmailWithPinQuery.hook.d.ts +6 -0
- package/dist/types/hooks/index.d.ts +3 -1
- package/dist/types/interfaces/PriceChange.d.ts +1 -0
- package/package.json +1 -1
- package/src/hooks/Aprc/get/getPriceChangePinQuery.hook.ts +16 -0
- package/src/hooks/Aprc/others/postPriceChangePinQuery.hook.ts +19 -0
- package/src/hooks/Aprc/others/sendEmailWithPinQuery.hook.ts +19 -0
- package/src/hooks/index.ts +5 -1
- package/src/interfaces/PriceChange.ts +1 -0
- package/src/hooks/Others/getPriceChangePinQuery.hook.ts +0 -11
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import { PrinceChange } from "../../../interfaces";
|
|
3
|
+
type PriceChangePinQueryOptions = Omit<UseQueryOptions<PrinceChange, unknown>, 'queryKey' | 'queryFn'>;
|
|
4
|
+
export declare const getPriceChangePinQueryHook: (storeId: string, options?: PriceChangePinQueryOptions) => UseQueryResult<PrinceChange, unknown>;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { PrinceChange } from "../../../interfaces";
|
|
3
|
+
export interface PriceChangeProps extends UseQueryOptions<PrinceChange> {
|
|
4
|
+
storeId: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const postPriceChangePinQueryHook: ({ storeId }: PriceChangeProps) => import("@tanstack/react-query").UseMutationResult<PrinceChange, unknown, PrinceChange, unknown>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { PrinceChange } from "../../../interfaces";
|
|
3
|
+
export interface EmailWithPinChangeProps extends UseQueryOptions<PrinceChange> {
|
|
4
|
+
storeId: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const sendEmailWithPinQueryHook: ({ storeId }: EmailWithPinChangeProps) => import("@tanstack/react-query").UseMutationResult<PrinceChange, unknown, PrinceChange, unknown>;
|
|
@@ -99,6 +99,9 @@ export * from './Asta/Actions/others/deleteActionQuery.hook';
|
|
|
99
99
|
export * from './Asta/Actions/others/extractActionQuery.hook';
|
|
100
100
|
export * from './Asta/Actions/others/archiveActionQuery.hook';
|
|
101
101
|
export * from './Asta/Actions/others/finishActionQuery.hook';
|
|
102
|
+
export * from './Aprc/get/getPriceChangePinQuery.hook';
|
|
103
|
+
export * from './Aprc/others/postPriceChangePinQuery.hook';
|
|
104
|
+
export * from './Aprc/others/sendEmailWithPinQuery.hook';
|
|
102
105
|
export * from './Others/useJobTitlesQuery.hook';
|
|
103
106
|
export * from './Others/useContractStatesQuery.hook';
|
|
104
107
|
export * from './Others/useApplicationDataQuery.hook';
|
|
@@ -111,6 +114,5 @@ export * from './Others/postVerifyImageQuery.hook';
|
|
|
111
114
|
export * from './Others/getWeeklyWorkloadQuery.hook';
|
|
112
115
|
export * from './Others/getNotificationTitleQuery.hook';
|
|
113
116
|
export * from './Others/getUserEmailStatusQuery.hook';
|
|
114
|
-
export * from './Others/getPriceChangePinQuery.hook';
|
|
115
117
|
export * from './Others/getRegulationQuery.hook';
|
|
116
118
|
export * from './Others/useRegulationQuery.hook';
|
package/package.json
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import { PrinceChange } from "../../../interfaces";
|
|
3
|
+
import { getAuth0 } from "../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
type PriceChangePinQueryOptions = Omit<UseQueryOptions<PrinceChange, unknown>, 'queryKey' | 'queryFn'>;
|
|
6
|
+
|
|
7
|
+
export const getPriceChangePinQueryHook = (storeId: string, options?: PriceChangePinQueryOptions): UseQueryResult<PrinceChange, unknown> => {
|
|
8
|
+
return useQuery(
|
|
9
|
+
['PRICE_CHANGE_PIN_QUERY', storeId],
|
|
10
|
+
() => getAuth0<PrinceChange>(`/GNG/Users/Pin/${storeId}`),
|
|
11
|
+
{
|
|
12
|
+
enabled: !!storeId,
|
|
13
|
+
...options,
|
|
14
|
+
},
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { UseQueryOptions, useMutation, useQueryClient } from "@tanstack/react-query";
|
|
2
|
+
import { PrinceChange } from "../../../interfaces";
|
|
3
|
+
import { postAuth0 } from "../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
export interface PriceChangeProps extends UseQueryOptions<PrinceChange> {
|
|
6
|
+
storeId: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const postPriceChangePinQueryHook = ({ storeId }: PriceChangeProps) => {
|
|
10
|
+
const queryClient = useQueryClient();
|
|
11
|
+
return useMutation<PrinceChange, unknown, PrinceChange>(() => {
|
|
12
|
+
return postAuth0(`/GNG/Users/Pin/${storeId}`)
|
|
13
|
+
}, {
|
|
14
|
+
onSuccess: (data: PrinceChange) => {
|
|
15
|
+
queryClient.setQueryData(
|
|
16
|
+
['PRICE_CHANGE_PIN_QUERY'], data);
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { UseQueryOptions, useMutation, useQueryClient } from "@tanstack/react-query";
|
|
2
|
+
import { PrinceChange } from "../../../interfaces";
|
|
3
|
+
import { postAuth0 } from "../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
export interface EmailWithPinChangeProps extends UseQueryOptions<PrinceChange> {
|
|
6
|
+
storeId: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const sendEmailWithPinQueryHook = ({ storeId }: EmailWithPinChangeProps) => {
|
|
10
|
+
const queryClient = useQueryClient();
|
|
11
|
+
return useMutation<PrinceChange, unknown, PrinceChange>(() => {
|
|
12
|
+
return postAuth0(`/GNG/Users/Pin/Email/${storeId}`)
|
|
13
|
+
}, {
|
|
14
|
+
onSuccess: (data: PrinceChange) => {
|
|
15
|
+
queryClient.setQueryData(
|
|
16
|
+
['EMAIL_PIN_QUERY'], data);
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
}
|
package/src/hooks/index.ts
CHANGED
|
@@ -129,6 +129,11 @@ export * from './Asta/Actions/others/extractActionQuery.hook';
|
|
|
129
129
|
export * from './Asta/Actions/others/archiveActionQuery.hook';
|
|
130
130
|
export * from './Asta/Actions/others/finishActionQuery.hook';
|
|
131
131
|
|
|
132
|
+
//APRC
|
|
133
|
+
export * from './Aprc/get/getPriceChangePinQuery.hook';
|
|
134
|
+
export * from './Aprc/others/postPriceChangePinQuery.hook';
|
|
135
|
+
export * from './Aprc/others/sendEmailWithPinQuery.hook';
|
|
136
|
+
|
|
132
137
|
//Others
|
|
133
138
|
export * from './Others/useJobTitlesQuery.hook';
|
|
134
139
|
export * from './Others/useContractStatesQuery.hook';
|
|
@@ -142,6 +147,5 @@ export * from './Others/postVerifyImageQuery.hook';
|
|
|
142
147
|
export * from './Others/getWeeklyWorkloadQuery.hook';
|
|
143
148
|
export * from './Others/getNotificationTitleQuery.hook';
|
|
144
149
|
export * from './Others/getUserEmailStatusQuery.hook';
|
|
145
|
-
export * from './Others/getPriceChangePinQuery.hook';
|
|
146
150
|
export * from './Others/getRegulationQuery.hook';
|
|
147
151
|
export * from './Others/useRegulationQuery.hook';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { useQuery } from "@tanstack/react-query";
|
|
2
|
-
import { PrinceChange } from "../../interfaces";
|
|
3
|
-
import { getAuth0 } from "../../services/ApiService";
|
|
4
|
-
|
|
5
|
-
export const getPriceChangePinQueryHook = () => {
|
|
6
|
-
return useQuery(
|
|
7
|
-
['PRICE_CHANGE_PIN_QUERY'],
|
|
8
|
-
() => getAuth0<PrinceChange>(`/GNG/Users/Pin`),
|
|
9
|
-
);
|
|
10
|
-
}
|
|
11
|
-
|