@omniumretail/shared-resources 0.1.87 → 0.1.88
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,9 @@
|
|
|
1
1
|
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
-
|
|
2
|
+
interface TermsAndConditionsURLProps {
|
|
3
|
+
TermsAndConditionsURL: string;
|
|
4
|
+
}
|
|
5
|
+
export interface RegulationQueryProps extends UseQueryOptions<TermsAndConditionsURLProps> {
|
|
6
|
+
userId: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const useRegulationQueryHook: ({ userId }: RegulationQueryProps) => import("@tanstack/react-query").UseMutationResult<RegulationQueryProps, unknown, string, unknown>;
|
|
9
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import { putAuth0 } from '../..';
|
|
2
|
-
import {
|
|
2
|
+
import { UseQueryOptions, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
3
3
|
|
|
4
|
-
interface
|
|
4
|
+
interface TermsAndConditionsURLProps {
|
|
5
5
|
TermsAndConditionsURL: string;
|
|
6
|
+
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface RegulationQueryProps extends UseQueryOptions<TermsAndConditionsURLProps> {
|
|
10
|
+
userId: string;
|
|
6
11
|
}
|
|
7
12
|
|
|
8
|
-
export const useRegulationQueryHook = (userId
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
export const useRegulationQueryHook = ({ userId }: RegulationQueryProps) => {
|
|
14
|
+
const queryClient = useQueryClient();
|
|
15
|
+
return useMutation<RegulationQueryProps, unknown, string>(() => {
|
|
16
|
+
return putAuth0(`/AACP/Users/${userId}/termsAndConditions`);
|
|
17
|
+
}, {
|
|
18
|
+
onSuccess: (data: RegulationQueryProps) => {
|
|
19
|
+
queryClient.setQueryData(['PUT_REGULATION_QUERY'], data);
|
|
20
|
+
},
|
|
21
|
+
});
|
|
14
22
|
};
|