@omniumretail/shared-resources 0.1.56 → 0.1.58
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/AsvProduct/get/getProductsByStoreQuery.hook.d.ts +2 -1
- package/package.json +1 -1
- package/src/hooks/AprProduct/get/useProductHierarchies.hook.ts +1 -1
- package/src/hooks/AprProduct/get/useProductRecommendations.hook.ts +1 -1
- package/src/hooks/AprProduct/get/useProductsByRefQuery.hook.ts +1 -1
- package/src/hooks/AprProduct/get/useProductsQuery.hook.ts +2 -2
- package/src/hooks/AsvProduct/get/getProductsByStoreQuery.hook.ts +4 -2
- package/src/hooks/Others/postCheckoutsMutateQuery.hook.ts +1 -1
|
@@ -4,7 +4,8 @@ export interface ProductsByStoreProps extends UseQueryOptions<ResponseList<"Stoc
|
|
|
4
4
|
reference: string;
|
|
5
5
|
storeCode: string;
|
|
6
6
|
hasStock?: boolean;
|
|
7
|
+
filterColor?: boolean;
|
|
7
8
|
sortBy?: string;
|
|
8
9
|
sortDirection?: string;
|
|
9
10
|
}
|
|
10
|
-
export declare const getProductsByStore: ({ reference, storeCode, hasStock, sortBy, sortDirection }: ProductsByStoreProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"StockList", AsvProductsByStore>, unknown>;
|
|
11
|
+
export declare const getProductsByStore: ({ reference, storeCode, hasStock, filterColor, sortBy, sortDirection }: ProductsByStoreProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"StockList", AsvProductsByStore>, unknown>;
|
package/package.json
CHANGED
|
@@ -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>>('/
|
|
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>>('/
|
|
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>(`/
|
|
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('/
|
|
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>>('/
|
|
29
|
+
get<ResponseList<"Products", Product>>('/APRE/Products', {
|
|
30
30
|
pPage: pageParam,
|
|
31
31
|
pRecords: 50,
|
|
32
32
|
pSortBy: sortBy,
|
|
@@ -6,17 +6,19 @@ export interface ProductsByStoreProps extends UseQueryOptions<ResponseList<"Stoc
|
|
|
6
6
|
reference: string;
|
|
7
7
|
storeCode: string;
|
|
8
8
|
hasStock?: boolean;
|
|
9
|
+
filterColor?: boolean;
|
|
9
10
|
sortBy?: string;
|
|
10
11
|
sortDirection?: string;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
export const getProductsByStore = ({ reference, storeCode, hasStock, sortBy, sortDirection }: ProductsByStoreProps) => {
|
|
14
|
+
export const getProductsByStore = ({ reference, storeCode, hasStock, filterColor, sortBy, sortDirection }: ProductsByStoreProps) => {
|
|
14
15
|
return useQuery(
|
|
15
|
-
['ASV_PRODUCT_BY_STORE', reference, storeCode, hasStock, sortBy, sortDirection],
|
|
16
|
+
['ASV_PRODUCT_BY_STORE', reference, storeCode, hasStock, filterColor, sortBy, sortDirection],
|
|
16
17
|
() => get<ResponseList<"StockList", AsvProductsByStore>>('/ASV/Products', {
|
|
17
18
|
pReference: reference,
|
|
18
19
|
pStoreCode: storeCode,
|
|
19
20
|
pHasStock: hasStock,
|
|
21
|
+
pRefColor: filterColor,
|
|
20
22
|
pSortBy: sortBy,
|
|
21
23
|
pSortDirection: sortDirection
|
|
22
24
|
}),
|
|
@@ -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('/
|
|
8
|
+
return post('/APRE/Checkouts', data);
|
|
9
9
|
}, {
|
|
10
10
|
onSuccess: (data: Checkout) => {
|
|
11
11
|
queryClient.setQueryData(
|