@omniumretail/shared-resources 0.1.26 → 0.1.28

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,3 +1,6 @@
1
1
  import { Product } from '../../../';
2
2
  import { UseQueryOptions } from '@tanstack/react-query';
3
- export declare const useProductsByRefQueryHook: (productRef: string, options?: UseQueryOptions<Product>) => import("@tanstack/react-query").UseQueryResult<Product, unknown>;
3
+ export interface useProductsByRefQueryHookInterface extends UseQueryOptions<Product> {
4
+ storeCode?: string;
5
+ }
6
+ export declare const useProductsByRefQueryHook: (productRef: string, { storeCode, ...options }: useProductsByRefQueryHookInterface) => import("@tanstack/react-query").UseQueryResult<Product, unknown>;
@@ -0,0 +1,2 @@
1
+ import { VerifyUser } from '../../interfaces';
2
+ export declare const postVerifyImageQueryHook: () => import("@tanstack/react-query").UseMutationResult<VerifyUser, unknown, VerifyUser, unknown>;
@@ -51,3 +51,4 @@ export * from './Others/useCountriesQuery.hook';
51
51
  export * from './Others/useCreateNotification.hook';
52
52
  export * from './Others/postCheckoutsMutateQuery.hook';
53
53
  export * from './Others/postVerifyUserQuery.hook';
54
+ export * from './Others/postVerifyImageQuery.hook';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.1.26",
3
+ "version": "0.1.28",
4
4
  "private": false,
5
5
  "description": "Shared Components and services or utils to the frontend versions",
6
6
  "main": "dist/bundle.js",
@@ -1,10 +1,16 @@
1
1
  import { get, Product } from '../../../';
2
2
  import { useQuery, UseQueryOptions } from '@tanstack/react-query';
3
3
 
4
- export const useProductsByRefQueryHook = (productRef: string, options?:UseQueryOptions<Product>) => {
4
+ export interface useProductsByRefQueryHookInterface extends UseQueryOptions<Product> {
5
+ storeCode?: string;
6
+ }
7
+
8
+ export const useProductsByRefQueryHook = (productRef: string, {storeCode, ...options} : useProductsByRefQueryHookInterface) => {
5
9
  return useQuery(
6
10
  ['PRODUCT_BY_REF', productRef],
7
- () => get<Product>(`/Recommendations/Products/${productRef}`),
11
+ () => get<Product>(`/Recommendations/Products/${productRef}`, {
12
+ pStoreCode: storeCode
13
+ }),
8
14
  options
9
15
  );
10
16
  };
@@ -0,0 +1,15 @@
1
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
2
+ import { VerifyUser } from '../../interfaces';
3
+ import { postAuth0 } from '../../services/ApiService';
4
+
5
+ export const postVerifyImageQueryHook = () => {
6
+ const queryClient = useQueryClient();
7
+ return useMutation<VerifyUser, unknown, VerifyUser>((data: VerifyUser) => {
8
+ return postAuth0('/AACP/FaceAuthentication/verify', {}, data);
9
+ }, {
10
+ onSuccess: (data: VerifyUser) => {
11
+ queryClient.setQueryData(
12
+ ['VERIFY_IMAGE'], data);
13
+ },
14
+ });
15
+ }
@@ -70,3 +70,4 @@ export * from './Others/useCountriesQuery.hook';
70
70
  export * from './Others/useCreateNotification.hook';
71
71
  export * from './Others/postCheckoutsMutateQuery.hook';
72
72
  export * from './Others/postVerifyUserQuery.hook';
73
+ export * from './Others/postVerifyImageQuery.hook';