@omniumretail/shared-resources 0.1.92 → 0.1.94

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,5 @@
1
+ import { UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
1
2
  import { PrinceChange } from "../../../interfaces";
2
- export declare const getPriceChangePinQueryHook: (storeId: string) => import("@tanstack/react-query").UseQueryResult<PrinceChange, unknown>;
3
+ type PriceChangePinQueryOptions = Omit<UseQueryOptions<PrinceChange, unknown>, 'queryKey' | 'queryFn'>;
4
+ export declare const getPriceChangePinQueryHook: (storeId: string, options?: PriceChangePinQueryOptions) => UseQueryResult<PrinceChange, unknown>;
5
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.1.92",
3
+ "version": "0.1.94",
4
4
  "private": false,
5
5
  "description": "Shared Components and services or utils to the frontend versions",
6
6
  "main": "dist/bundle.js",
@@ -1,14 +1,16 @@
1
- import { useQuery } from "@tanstack/react-query";
1
+ import { useQuery, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
2
2
  import { PrinceChange } from "../../../interfaces";
3
3
  import { getAuth0 } from "../../../services/ApiService";
4
4
 
5
- export const getPriceChangePinQueryHook = (storeId: string) => {
5
+ type PriceChangePinQueryOptions = Omit<UseQueryOptions<PrinceChange, unknown>, 'queryKey' | 'queryFn'>;
6
+
7
+ export const getPriceChangePinQueryHook = (storeId: string, options?: PriceChangePinQueryOptions): UseQueryResult<PrinceChange, unknown> => {
6
8
  return useQuery(
7
9
  ['PRICE_CHANGE_PIN_QUERY', storeId],
8
10
  () => getAuth0<PrinceChange>(`/GNG/Users/Pin/${storeId}`),
9
11
  {
10
- enabled: !!(storeId),
12
+ enabled: !!storeId,
13
+ ...options,
11
14
  },
12
15
  );
13
16
  }
14
-
@@ -14,7 +14,7 @@ interface StoreQueryProps extends UseQueryOptions<ResponseList<"Locations", Stor
14
14
 
15
15
  export const useAllStoreQuery = ({ records, sortBy, sortDirection, tags, advancedTags, filter, page, ...options }: StoreQueryProps) => {
16
16
  const pQueryValue = advancedTags && filter
17
- ? `${advancedTags} and ${filter}`
17
+ ? `${advancedTags} AND ${filter}`
18
18
  : advancedTags
19
19
  ? advancedTags
20
20
  : filter