npm-pkg-hook 1.7.4 → 1.7.6
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/expire.json +1 -0
- package/package.json +1 -1
- package/src/hooks/generateStoreURL/index.js +3 -2
- package/src/hooks/updateExtProductFoodsOptional/index.js +1 -1
- package/src/hooks/useCatWithProduct/index.js +5 -4
- package/src/hooks/useDessert/index.js +1 -1
- package/src/hooks/useManageQueryParams/index.js +0 -1
- package/src/hooks/useSales/index.js +20 -8
package/expire.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiSmVzdXMgSnV2aW5hbyIsImVtYWlsIjoianV2aW5hb2plc3VzZEBnbWFpbC5jb20iLCJ1c2VybmFtZSI6Ikplc3VzIEp1dmluYW8iLCJyZXN0YXVyYW50Ijp7ImlkU3RvcmUiOiIwMTNlNTM4Ny0zNGExLTZhNzgtMzAzZC01MDk4ZjE3YmY2NDAiLCJpZCI6IjAxM2U1Mzg3LTM0YTEtNmE3OC0zMDNkLTUwOThmMTdiZjY0MCJ9LCJpZCI6IjAxM2U1Mzg3LTM0YTEtNmE3OC0zMDNkLTUwOThmMTdiZjY0MCIsImlhdCI6MTcwNjY3MTkwOCwiZXhwIjoxNzA3MDA1MjA4fQ.V---HeOaEMX9tow6Yh-33ehM6HV-h-1YQ8dmxJfVcyE
|
package/package.json
CHANGED
|
@@ -10,7 +10,8 @@ export const generateStoreURL = ({
|
|
|
10
10
|
city,
|
|
11
11
|
department,
|
|
12
12
|
storeName,
|
|
13
|
-
idStore
|
|
13
|
+
idStore,
|
|
14
|
+
rootMainPath = 'delivery'
|
|
14
15
|
}) => {
|
|
15
16
|
try {
|
|
16
17
|
// Validate all necessary fields
|
|
@@ -30,7 +31,7 @@ export const generateStoreURL = ({
|
|
|
30
31
|
// Replace spaces in storeName with hyphens
|
|
31
32
|
const formattedStoreName = storeName.replace(/\s+/g, '-')
|
|
32
33
|
|
|
33
|
-
return `${process.env.MAIN_URL_BASE}
|
|
34
|
+
return `${process.env.MAIN_URL_BASE}/${rootMainPath}/${cityName}-${departmentName}/${formattedStoreName}/${idStore}`
|
|
34
35
|
} catch (_) {
|
|
35
36
|
return '/'
|
|
36
37
|
}
|
|
@@ -12,16 +12,17 @@ export const useCatWithProduct = ({
|
|
|
12
12
|
gender,
|
|
13
13
|
desc,
|
|
14
14
|
speciality
|
|
15
|
-
} = searchFilter ?? {
|
|
15
|
+
} = searchFilter ?? {
|
|
16
|
+
gender: [],
|
|
17
|
+
desc: null,
|
|
18
|
+
speciality: []
|
|
19
|
+
}
|
|
16
20
|
const {
|
|
17
21
|
data,
|
|
18
22
|
loading,
|
|
19
23
|
error,
|
|
20
24
|
fetchMore
|
|
21
25
|
} = useQuery(GET_ALL_CATEGORIES_WITH_PRODUCT, {
|
|
22
|
-
onCompleted: (data) => {
|
|
23
|
-
console.log('data', data)
|
|
24
|
-
},
|
|
25
26
|
fetchPolicy: 'network-only',
|
|
26
27
|
variables:
|
|
27
28
|
{
|
|
@@ -15,7 +15,7 @@ export * from './helpers'
|
|
|
15
15
|
export const useDessert = ({
|
|
16
16
|
pId = null,
|
|
17
17
|
initialData = null,
|
|
18
|
-
sendNotification = () => { }
|
|
18
|
+
sendNotification = (args) => { return args }
|
|
19
19
|
}) => {
|
|
20
20
|
const [selectedExtra, setSelectedExtra] = useState({})
|
|
21
21
|
const [openModalEditExtra, setOpenModalEditExtra] = useState(false)
|
|
@@ -137,7 +137,7 @@ export const useSales = ({
|
|
|
137
137
|
const [productFoodsOne, { data: dataProduct }] = useLazyQuery(
|
|
138
138
|
GET_ONE_PRODUCTS_FOOD
|
|
139
139
|
)
|
|
140
|
-
const [ExtProductFoodsSubOptionalAll] = useLazyQuery(
|
|
140
|
+
const [ExtProductFoodsSubOptionalAll, { loading: loadingExtProductFoodsSubOptionalAll }] = useLazyQuery(
|
|
141
141
|
GET_EXTRAS_PRODUCT_FOOD_OPTIONAL,
|
|
142
142
|
{
|
|
143
143
|
onError: () => {
|
|
@@ -302,6 +302,7 @@ export const useSales = ({
|
|
|
302
302
|
case 'REMOVE_ALL_PRODUCTS':
|
|
303
303
|
// @ts-ignore
|
|
304
304
|
setValues({
|
|
305
|
+
...values,
|
|
305
306
|
comment: '',
|
|
306
307
|
change: '',
|
|
307
308
|
valueDelivery: ''
|
|
@@ -498,6 +499,16 @@ export const useSales = ({
|
|
|
498
499
|
dataOptional: filteredDataOptional,
|
|
499
500
|
dataExtra: filteredDataExtra
|
|
500
501
|
})
|
|
502
|
+
const updatesOccurred = (
|
|
503
|
+
(dataExtra && dataExtra.length > 0)
|
|
504
|
+
)
|
|
505
|
+
if (updatesOccurred) {
|
|
506
|
+
return sendNotification({
|
|
507
|
+
title: 'Success',
|
|
508
|
+
backgroundColor: 'success',
|
|
509
|
+
description: 'Items subidos al producto'
|
|
510
|
+
})
|
|
511
|
+
}
|
|
501
512
|
}
|
|
502
513
|
} catch (_error) {
|
|
503
514
|
return sendNotification({
|
|
@@ -623,7 +634,7 @@ export const useSales = ({
|
|
|
623
634
|
if (item.pId === pId) {
|
|
624
635
|
return {
|
|
625
636
|
...item,
|
|
626
|
-
getOneTags: OurProduct
|
|
637
|
+
getOneTags: OurProduct?.genderTags,
|
|
627
638
|
unitPrice: OurProduct?.ProPrice,
|
|
628
639
|
ProPrice: isFree ? 0 : (productExist.ProQuantity + 1) * OurProduct?.ProPrice,
|
|
629
640
|
ProQuantity: productExist.ProQuantity + +1,
|
|
@@ -1068,13 +1079,14 @@ export const useSales = ({
|
|
|
1068
1079
|
setValues({})
|
|
1069
1080
|
setValuesDates({ fromDate: yearMonthDay, toDate: '' })
|
|
1070
1081
|
}
|
|
1071
|
-
|
|
1082
|
+
|
|
1083
|
+
const disabledModalItems = (dataOptional?.length > 0 || dataExtra?.length > 0) && !loadingExtProductFoodsSubOptionalAll
|
|
1072
1084
|
/**
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1085
|
+
* Filter products by carProId.
|
|
1086
|
+
* @param {Array} products - Array of products to filter.
|
|
1087
|
+
* @param {Array} carProIds - Array of carProId to filter by.
|
|
1088
|
+
* @returns {Array} - Filtered array of products or all products if no matches found.
|
|
1089
|
+
*/
|
|
1078
1090
|
function filterProductsByCarProId (products, carProIds) {
|
|
1079
1091
|
if (!Array.isArray(products)) {
|
|
1080
1092
|
return []
|