@omniumretail/shared-resources 0.1.57 → 0.1.59

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.
@@ -2,6 +2,8 @@ import { UseQueryOptions } from "@tanstack/react-query";
2
2
  import { JobTitles, ResponseList } from "../../interfaces";
3
3
  interface JobTitlesQueryProps extends Omit<UseQueryOptions<ResponseList<"JobTitles", JobTitles>>, "queryKey"> {
4
4
  records: string;
5
+ sortBy: string;
6
+ sortDirection: string;
5
7
  }
6
- export declare const useJobTitlesQuery: ({ records, ...options }: JobTitlesQueryProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"JobTitles", JobTitles>, unknown>;
8
+ export declare const useJobTitlesQuery: ({ records, sortBy, sortDirection, ...options }: JobTitlesQueryProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"JobTitles", JobTitles>, unknown>;
7
9
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.1.57",
3
+ "version": "0.1.59",
4
4
  "private": false,
5
5
  "description": "Shared Components and services or utils to the frontend versions",
6
6
  "main": "dist/bundle.js",
@@ -9,7 +9,7 @@ export interface useProductsHierarchiesQueryHook extends UseQueryOptions<Respons
9
9
  export const useProductsHierarchiesQueryHook = ({ terms, query, ...options }: useProductsHierarchiesQueryHook) => {
10
10
  return useQuery(
11
11
  ['PRODUCT_CATEGORIES', terms, query],
12
- () => get<ResponseList<"Categories", ProductsHierarchies>>('/Recommendations/Categories', {
12
+ () => get<ResponseList<"Categories", ProductsHierarchies>>('/APRE/Categories', {
13
13
  pTerms: terms,
14
14
  pQuery: query
15
15
  }),
@@ -13,7 +13,7 @@ export interface useProductsRecommendationsQueryHook extends UseQueryOptions<Res
13
13
  export const useProductRecommendationsHook = ({ sortBy, sortDirection, reference, category, type, companyId, ...options }: useProductsRecommendationsQueryHook) => {
14
14
  return useQuery(
15
15
  ['PRODUCT_RECOMMENDATIONS', sortBy, sortDirection, reference, category, type, companyId],
16
- () => get<ResponseList<"Products", Product>>('/Recommendations/Products/Recommendations', {
16
+ () => get<ResponseList<"Products", Product>>('/APRE/Products/Recommendations', {
17
17
  pSortBy: sortBy,
18
18
  pSortDirection: sortDirection,
19
19
  pReferences: reference,
@@ -9,7 +9,7 @@ export interface useProductsByRefQueryHookInterface extends UseQueryOptions<Prod
9
9
  export const useProductsByRefQueryHook = (productRef: string, {storeCode, companyId, ...options} : useProductsByRefQueryHookInterface) => {
10
10
  return useQuery(
11
11
  ['PRODUCT_BY_REF', productRef, storeCode, companyId],
12
- () => get<Product>(`/Recommendations/Products/${productRef}`, {
12
+ () => get<Product>(`/APRE/Products/${productRef}`, {
13
13
  pStoreCode: storeCode,
14
14
  pCompanyId: companyId
15
15
  }),
@@ -12,7 +12,7 @@ export interface ProductsQuery extends UseQueryOptions<ResponseList<"Products",
12
12
 
13
13
  export const useProductsQueryHook = ({ page, records, sortBy, sortDirection, terms, query, ...options }: ProductsQuery) => {
14
14
  return useQuery<ResponseList<"Products", Product>>(['PRODUCTS', page, records, sortBy, sortDirection, terms, query], () =>
15
- get('/Recommendations/Products', {
15
+ get('/APRE/Products', {
16
16
  pPage: page,
17
17
  pRecords: records || 50,
18
18
  pSortBy: sortBy,
@@ -26,7 +26,7 @@ export const useProductsQueryHook = ({ page, records, sortBy, sortDirection, ter
26
26
 
27
27
  export const useProductInfiniteQueryHook = ({ sortBy, sortDirection, terms, query }: Omit<ProductsQuery, 'page' | 'records'> = {}) => {
28
28
  const infiniteQuery = useInfiniteQuery(['PRODUCTS_INFINITE', sortBy, sortDirection, terms, query], ({ pageParam = 1 }) =>
29
- get<ResponseList<"Products", Product>>('/Recommendations/Products', {
29
+ get<ResponseList<"Products", Product>>('/APRE/Products', {
30
30
  pPage: pageParam,
31
31
  pRecords: 50,
32
32
  pSortBy: sortBy,
@@ -5,7 +5,7 @@ import { post } from '../../services/ApiService';
5
5
  export const postCheckoutsMutateQueryHook = () => {
6
6
  const queryClient = useQueryClient();
7
7
  return useMutation<Checkout, unknown, Checkout>((data: Checkout) => {
8
- return post('/Recommendations/Checkouts', data);
8
+ return post('/APRE/Checkouts', data);
9
9
  }, {
10
10
  onSuccess: (data: Checkout) => {
11
11
  queryClient.setQueryData(
@@ -4,12 +4,14 @@ import { getAuth0 } from "../../services";
4
4
 
5
5
  interface JobTitlesQueryProps extends Omit<UseQueryOptions<ResponseList<"JobTitles", JobTitles>>, "queryKey"> {
6
6
  records: string;
7
+ sortBy: string;
8
+ sortDirection: string;
7
9
  }
8
10
 
9
- export const useJobTitlesQuery = ({ records, ...options }: JobTitlesQueryProps) => {
11
+ export const useJobTitlesQuery = ({ records, sortBy, sortDirection, ...options }: JobTitlesQueryProps) => {
10
12
  return useQuery(
11
- ['JOBTITLES_QUERY', records],
12
- () => getAuth0<ResponseList<"JobTitles", JobTitles>>(`/AACP/JobTitles`, { pPage: 1, pRecords: records || 195 }),
13
+ ['JOBTITLES_QUERY', records, sortBy, sortDirection],
14
+ () => getAuth0<ResponseList<"JobTitles", JobTitles>>(`/AACP/JobTitles`, { pPage: 1, pRecords: records || 195, pSortBy: sortBy || "Rank", pSortDirection: sortDirection || "asc" }),
13
15
  options
14
16
  );
15
17
  }