npm-pkg-hook 1.1.5 → 1.1.8

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.
Files changed (140) hide show
  1. package/.eslintrc.js +19 -113
  2. package/.eslintrc.json +127 -108
  3. package/next.config.js +2 -5
  4. package/package.json +27 -24
  5. package/src/config/client/errors.js +14 -14
  6. package/src/config/client/index.js +1 -1
  7. package/src/hooks/getCategoriesWithProduct/helpers/index.js +7 -0
  8. package/src/hooks/getCategoriesWithProduct/index.js +62 -0
  9. package/src/hooks/getSession/index.js +18 -18
  10. package/src/hooks/index.js +13 -9
  11. package/src/hooks/useAcumulateDate/index.js +1 -1
  12. package/src/hooks/useAnimationFrame/index.js +45 -45
  13. package/src/hooks/useAsideCart/helpers/index.js +22 -0
  14. package/src/hooks/useAsideCart/index.js +156 -0
  15. package/src/hooks/useAsideCart/queries.js +10 -0
  16. package/src/hooks/useBanner/index.js +11 -11
  17. package/src/hooks/useCart/index.js +2 -0
  18. package/src/hooks/useCart/queries.js +164 -0
  19. package/src/hooks/useCart/useCart/helpers/index.js +75 -0
  20. package/src/hooks/useCart/useCart/index.js +411 -0
  21. package/src/hooks/useCart/useGetCart/index.js +31 -0
  22. package/src/hooks/useCatWithProduct/index.js +15 -15
  23. package/src/hooks/useCatWithProduct/queries.js +1 -1
  24. package/src/hooks/useCatWithProductClient/index.js +48 -0
  25. package/src/hooks/useCatWithProductClient/queries.js +55 -0
  26. package/src/hooks/useCategoriesProduct/index.js +12 -12
  27. package/src/hooks/useCategoriesProduct/queries.js +16 -16
  28. package/src/hooks/useCategoryInStore/index.js +39 -36
  29. package/src/hooks/useCategoryInStore/queries.js +78 -78
  30. package/src/hooks/useCategoryStore/index.js +2 -2
  31. package/src/hooks/useChartData/index.js +159 -156
  32. package/src/hooks/useChartData/useChartData/index.js +199 -197
  33. package/src/hooks/useChartData/useChartDataAllOrders/index.js +94 -94
  34. package/src/hooks/useCheckbox/index.js +115 -115
  35. package/src/hooks/useClients/index.js +12 -14
  36. package/src/hooks/useClients/queries.js +1 -1
  37. package/src/hooks/useConnection/index.js +20 -21
  38. package/src/hooks/useCreateProduct/helpers/useEditImageProduct/index.js +6 -2
  39. package/src/hooks/useCreateProduct/index.js +22 -19
  40. package/src/hooks/useDeleteSubProductOptional/index.js +31 -30
  41. package/src/hooks/useDeleteSubProductOptional/queries.js +10 -10
  42. package/src/hooks/useDessert/helpers/index.js +51 -51
  43. package/src/hooks/useDessert/index.js +56 -65
  44. package/src/hooks/useDevices/index.js +35 -36
  45. package/src/hooks/useDevices/queries.js +19 -19
  46. package/src/hooks/useDropzone/index.js +94 -79
  47. package/src/hooks/useDynamicAuth/index.js +13 -13
  48. package/src/hooks/useDynamicAuth/queries.js +24 -24
  49. package/src/hooks/useEmployee/queries.js +1 -1
  50. package/src/hooks/useEvent/index.js +33 -33
  51. package/src/hooks/useFavoriteStores/index.js +19 -0
  52. package/src/hooks/useFavoriteStores/queries.js +47 -0
  53. package/src/hooks/useFetchJson/index.js +25 -25
  54. package/src/hooks/useFingerprintjs/index.js +172 -176
  55. package/src/hooks/useFormTools/index.js +12 -11
  56. package/src/hooks/useFormatDate/index.js +20 -21
  57. package/src/hooks/useFormatNumberPhone/index.js +9 -9
  58. package/src/hooks/useFullScreenMode/index.js +65 -65
  59. package/src/hooks/useGenerateNumberArray/index.js +17 -17
  60. package/src/hooks/useGetExtProductFoodsSubOptionalAll/index.js +14 -0
  61. package/src/hooks/useGetFoodRecomended/index.js +33 -0
  62. package/src/hooks/useGetFoodRecomended/queries.js +47 -0
  63. package/src/hooks/useGetMinPrice/index.js +8 -0
  64. package/src/hooks/useGetMinPrice/queries.js +7 -0
  65. package/src/hooks/useGetOneStoreRating/index.js +40 -0
  66. package/src/hooks/useGetOneStoreRating/queries.js +18 -0
  67. package/src/hooks/useGoogleLogin/index.js +160 -161
  68. package/src/hooks/useHover/index.js +29 -29
  69. package/src/hooks/useImageOptimization/index.js +15 -15
  70. package/src/hooks/useImageWeight/index.js +18 -19
  71. package/src/hooks/useImagesStore/index.js +139 -140
  72. package/src/hooks/useImagesStore/queries.js +19 -18
  73. package/src/hooks/useInnerHtml/index.js +39 -38
  74. package/src/hooks/useIntersection/index.js +4 -4
  75. package/src/hooks/useKeypress/index.js +28 -28
  76. package/src/hooks/useLazyScript/index.js +35 -36
  77. package/src/hooks/useLocalSorage/index.js +2 -2
  78. package/src/hooks/useLogout/index.js +23 -23
  79. package/src/hooks/useManageQueryParams/index.js +36 -37
  80. package/src/hooks/useMobile/index.js +39 -38
  81. package/src/hooks/useMutateHeight/index.js +15 -16
  82. package/src/hooks/useOrderClient/index.js +5 -0
  83. package/src/hooks/useOrders/index.js +10 -16
  84. package/src/hooks/useOrders/queries.js +1 -1
  85. package/src/hooks/useProductsFood/index.js +32 -32
  86. package/src/hooks/useProductsFood/queriesStore.js +49 -48
  87. package/src/hooks/useProductsFood/useEditProduct.js +2 -4
  88. package/src/hooks/useProductsFood/usetagsProducts.js +83 -83
  89. package/src/hooks/useProviders/index.js +3 -3
  90. package/src/hooks/useProviders/queries.js +31 -31
  91. package/src/hooks/useProviders/useProvidersCreateStore/index.js +12 -13
  92. package/src/hooks/useProviders/useProvidersDataStore/index.js +24 -24
  93. package/src/hooks/useProvidersStore/index.js +24 -24
  94. package/src/hooks/useProvidersStore/queries.js +31 -31
  95. package/src/hooks/useRatingArrayData/index.js +54 -0
  96. package/src/hooks/{useRatingData → useRatingArrayData}/queries.js +19 -18
  97. package/src/hooks/useReactToPrint/index.js +1120 -1098
  98. package/src/hooks/useRemoveExtraProductFoodsOptional/index.js +23 -23
  99. package/src/hooks/useRemoveExtraProductFoodsOptional/queries.js +48 -48
  100. package/src/hooks/useReport/index.js +9 -9
  101. package/src/hooks/useReport/queries.js +1 -1
  102. package/src/hooks/useRestaurant/index.js +19 -19
  103. package/src/hooks/useRestaurant/queries.js +80 -80
  104. package/src/hooks/useSales/index.js +476 -451
  105. package/src/hooks/useSales/queries.js +14 -15
  106. package/src/hooks/useSales/useGetAllSales/index.js +25 -25
  107. package/src/hooks/useSales/useTotalSales.js +18 -18
  108. package/src/hooks/useSaveAvailableProduct/helpers/index.js +29 -29
  109. package/src/hooks/useSaveAvailableProduct/index.js +16 -16
  110. package/src/hooks/useSaveAvailableProduct/queries.js +1 -1
  111. package/src/hooks/useSchedule/index.js +33 -36
  112. package/src/hooks/useSchedule/index.jsx +22 -22
  113. package/src/hooks/useSchedule/queries.js +34 -35
  114. package/src/hooks/useScheduleData/index.js +123 -171
  115. package/src/hooks/useScroll/index.js +56 -57
  116. package/src/hooks/useScrollRotate/index.js +16 -14
  117. package/src/hooks/useSetSession/index.js +16 -16
  118. package/src/hooks/useSetState/index.js +3 -3
  119. package/src/hooks/useStatusOpenStore/helpers/index.js +101 -102
  120. package/src/hooks/useStatusOpenStore/index.js +172 -173
  121. package/src/hooks/useStatusOrdersClient/helpers/index.js +14 -0
  122. package/src/hooks/useStatusOrdersClient/index.js +17 -0
  123. package/src/hooks/useStatusOrdersClient/queries.js +80 -0
  124. package/src/hooks/useStore/index.js +40 -25
  125. package/src/hooks/useStore/queries.js +162 -136
  126. package/src/hooks/useStoreCalendar/index.js +5 -7
  127. package/src/hooks/useStoreContacts/index.js +16 -16
  128. package/src/hooks/useStoreContacts/queries.js +1 -1
  129. package/src/hooks/useTimeAgo/useTimeAgo.js +39 -39
  130. package/src/hooks/useUpdateCart/index.js +34 -28
  131. package/src/hooks/useUpdateExistingOrders/index.js +35 -35
  132. package/src/hooks/useUpdateExtProductFoodsSubOptional/index.js +38 -37
  133. package/src/hooks/useUser/index.js +1 -1
  134. package/src/hooks/useUser/queries.js +1 -1
  135. package/src/hooks/useWindowSize/index.js +38 -38
  136. package/src/mock/dessert/index.js +16 -16
  137. package/src/mock/index.js +1 -2
  138. package/src/utils/index.js +42 -45
  139. package/src/hooks/useRatingData/index.js +0 -53
  140. package/src/hooks/useSalesClient/index.js +0 -1
@@ -1,4 +1,4 @@
1
- import { gql } from "@apollo/client";
1
+ import { gql } from '@apollo/client'
2
2
 
3
3
  export const CREATE_SCHEDULE_STORE = gql`
4
4
  mutation setStoreSchedule($input: IsStoreSchedule!) {
@@ -7,7 +7,7 @@ export const CREATE_SCHEDULE_STORE = gql`
7
7
  message
8
8
  }
9
9
  }
10
- `;
10
+ `
11
11
  export const GET_SCHEDULE_STORE = gql`
12
12
  query getStoreSchedules($schDay: Int, $idStore: ID) {
13
13
  getStoreSchedules(schDay: $schDay, idStore: $idStore) {
@@ -19,7 +19,7 @@ export const GET_SCHEDULE_STORE = gql`
19
19
  schState
20
20
  }
21
21
  }
22
- `;
22
+ `
23
23
  export const GET_ONE_SCHEDULE_STORE = gql`
24
24
  query getOneStoreSchedules($schDay: Int, $idStore: ID) {
25
25
  getOneStoreSchedules(schDay: $schDay, idStore: $idStore) {
@@ -30,7 +30,7 @@ export const GET_ONE_SCHEDULE_STORE = gql`
30
30
  schState
31
31
  }
32
32
  }
33
- `;
33
+ `
34
34
  export const GET_CAT_OF_PRODUCTS = gql`
35
35
  query getAllCatOfProducts($idStore: ID) {
36
36
  getAllCatOfProducts(idStore: $idStore) {
@@ -41,7 +41,7 @@ export const GET_CAT_OF_PRODUCTS = gql`
41
41
  schState
42
42
  }
43
43
  }
44
- `;
44
+ `
45
45
  export const REGISTER_CAT_OF_PRODUCTS = gql`
46
46
  mutation updatedProducts($input: InputCatProducts) {
47
47
  updatedProducts(input: $input) {
@@ -49,7 +49,7 @@ export const REGISTER_CAT_OF_PRODUCTS = gql`
49
49
  message
50
50
  }
51
51
  }
52
- `;
52
+ `
53
53
  export const REGISTER_CONTRACT_STORE = gql`
54
54
  mutation createOneContract($input: InputContractType) {
55
55
  createOneContract(input: $input) {
@@ -57,7 +57,7 @@ export const REGISTER_CONTRACT_STORE = gql`
57
57
  message
58
58
  }
59
59
  }
60
- `;
60
+ `
61
61
  export const GET_ALL_EMPLOYEE_STORE = gql`
62
62
  query employees($umId: ID, $cId: ID, $aId: ID) {
63
63
  employees(umId: $umId, cId: $cId, aId: $aId) {
@@ -73,7 +73,7 @@ export const GET_ALL_EMPLOYEE_STORE = gql`
73
73
  eState
74
74
  }
75
75
  }
76
- `;
76
+ `
77
77
 
78
78
  export const GET_ALL_PRODUCT_STORE = gql`
79
79
  query productFoodsAll(
@@ -146,7 +146,7 @@ export const GET_ALL_PRODUCT_STORE = gql`
146
146
  }
147
147
  }
148
148
  }
149
- `;
149
+ `
150
150
  export const GET_ALL_RATING_START_STORE = gql`
151
151
  query getAllRatingStar($idStore: ID) {
152
152
  getAllRatingStar(idStore: $idStore) {
@@ -156,7 +156,7 @@ export const GET_ALL_RATING_START_STORE = gql`
156
156
  createAt
157
157
  }
158
158
  }
159
- `;
159
+ `
160
160
  export const GET_ALL_VISITOR_STORE = gql`
161
161
  query getAllVisitorStore(
162
162
  $idStore: ID
@@ -181,13 +181,14 @@ export const GET_ALL_VISITOR_STORE = gql`
181
181
  updateAt
182
182
  }
183
183
  }
184
- `;
184
+ `
185
185
  export const GET_MIN_PEDIDO = gql`
186
186
  query getMinPrice($idStore: ID) {
187
187
  getMinPrice(idStore: $idStore)
188
188
  }
189
- `;
189
+ `
190
190
 
191
+ // eslint-disable-next-line camelcase
191
192
  export const GET_All_RATING_STORE = gql`
192
193
  query getAllRating($idStore: ID) {
193
194
  getAllRating(idStore: $idStore) {
@@ -203,7 +204,7 @@ export const GET_All_RATING_STORE = gql`
203
204
  updateAt
204
205
  }
205
206
  }
206
- `;
207
+ `
207
208
  export const CREATE_LOGO = gql`
208
209
  mutation setALogoStore($logo: Upload, $idStore: ID) {
209
210
  setALogoStore(logo: $logo, idStore: $idStore) {
@@ -211,7 +212,7 @@ export const CREATE_LOGO = gql`
211
212
  message
212
213
  }
213
214
  }
214
- `;
215
+ `
215
216
  export const CREATE_BANNER_STORE = gql`
216
217
  mutation registerBanner($input: IBanner) {
217
218
  registerBanner(input: $input) {
@@ -219,7 +220,7 @@ export const CREATE_BANNER_STORE = gql`
219
220
  message
220
221
  }
221
222
  }
222
- `;
223
+ `
223
224
  export const DELETE_ONE_LOGO_STORE = gql`
224
225
  mutation deleteALogoStore($idStore: ID, $Image: String) {
225
226
  deleteALogoStore(idStore: $idStore, Image: $Image) {
@@ -227,7 +228,7 @@ export const DELETE_ONE_LOGO_STORE = gql`
227
228
  success
228
229
  }
229
230
  }
230
- `;
231
+ `
231
232
  export const GET_ONE_BANNER_STORE = gql`
232
233
  query getOneBanners($idStore: ID, $id: ID) {
233
234
  getOneBanners(idStore: $idStore, id: $id) {
@@ -241,7 +242,7 @@ export const GET_ONE_BANNER_STORE = gql`
241
242
  updateAt
242
243
  }
243
244
  }
244
- `;
245
+ `
245
246
  export const DELETE_ONE_BANNER_STORE = gql`
246
247
  mutation DeleteOneBanner(
247
248
  $bnState: Int
@@ -261,7 +262,7 @@ export const DELETE_ONE_BANNER_STORE = gql`
261
262
  message
262
263
  }
263
264
  }
264
- `;
265
+ `
265
266
 
266
267
  export const GET_ALL_PQR = gql`
267
268
  query getOnePqr($hpqrId: ID, $thpId: ID) {
@@ -271,7 +272,7 @@ export const GET_ALL_PQR = gql`
271
272
  hpqrQuestion
272
273
  }
273
274
  }
274
- `;
275
+ `
275
276
  export const GET_ONE_COLOR = gql`
276
277
  query getAllColor {
277
278
  getAllColor {
@@ -280,7 +281,7 @@ export const GET_ONE_COLOR = gql`
280
281
  colorState
281
282
  }
282
283
  }
283
- `;
284
+ `
284
285
  export const UPDATE = gql`
285
286
  mutation updateProducts($input: InputProduct) {
286
287
  updateProducts(input: $input) {
@@ -311,7 +312,7 @@ export const UPDATE = gql`
311
312
  ProVoltaje
312
313
  }
313
314
  }
314
- `;
315
+ `
315
316
  export const UPDATE_IMAGE_PRODUCT_FOOD = gql`
316
317
  mutation setImageProducts($input: IFileImageProductFood) {
317
318
  setImageProducts(input: $input) {
@@ -319,7 +320,7 @@ export const UPDATE_IMAGE_PRODUCT_FOOD = gql`
319
320
  message
320
321
  }
321
322
  }
322
- `;
323
+ `
323
324
  export const UPDATE_PRODUCT_FOOD = gql`
324
325
  mutation updateProductFoods($input: InputProductFood) {
325
326
  updateProductFoods(input: $input) {
@@ -353,7 +354,7 @@ export const UPDATE_PRODUCT_FOOD = gql`
353
354
  ProVoltaje
354
355
  }
355
356
  }
356
- `;
357
+ `
357
358
  // UPDATE EXTRAS
358
359
  export const UPDATE_EXTRAS_PRODUCT_FOOD = gql`
359
360
  mutation updateExtProductFoods($input: InputExtProductFood) {
@@ -368,7 +369,7 @@ export const UPDATE_EXTRAS_PRODUCT_FOOD = gql`
368
369
  pDatMod
369
370
  }
370
371
  }
371
- `;
372
+ `
372
373
  // EXTRA PRODUCTS
373
374
  export const UPDATE_EXTRAS_PRODUCT_FOOD_OPTIONAL = gql`
374
375
  mutation updateExtProductFoodsOptional($input: InputExtProductFoodOptional) {
@@ -382,7 +383,7 @@ export const UPDATE_EXTRAS_PRODUCT_FOOD_OPTIONAL = gql`
382
383
  numbersOptionalOnly
383
384
  }
384
385
  }
385
- `;
386
+ `
386
387
  export const GET_EXTRAS_PRODUCT_FOOD_OPTIONAL = gql`
387
388
  query ExtProductFoodsOptionalAll(
388
389
  $search: String
@@ -419,7 +420,7 @@ export const GET_EXTRAS_PRODUCT_FOOD_OPTIONAL = gql`
419
420
  }
420
421
  }
421
422
  }
422
- `;
423
+ `
423
424
  export const GET_EXTRAS_PRODUCT_FOOD_SUB_OPTIONAL = gql`
424
425
  mutation updateExtProductFoodsSubOptional(
425
426
  $input: InputExtProductFoodSubOptional
@@ -437,7 +438,7 @@ export const GET_EXTRAS_PRODUCT_FOOD_SUB_OPTIONAL = gql`
437
438
  pDatMod
438
439
  }
439
440
  }
440
- `;
441
+ `
441
442
 
442
443
  // CREATE EXTRAS PRODUCT
443
444
  export const UPDATE_MULTI_EXTRAS_PRODUCT_FOOD = gql`
@@ -455,7 +456,7 @@ export const UPDATE_MULTI_EXTRAS_PRODUCT_FOOD = gql`
455
456
  pDatMod
456
457
  }
457
458
  }
458
- `;
459
+ `
459
460
 
460
461
  export const DELETE_ONE_PRODUCT = gql`
461
462
  mutation deleteProducts($input: IDeleteProduct) {
@@ -463,7 +464,7 @@ export const DELETE_ONE_PRODUCT = gql`
463
464
  pId
464
465
  }
465
466
  }
466
- `;
467
+ `
467
468
  export const GET_ALL_PRODUCTS = gql`
468
469
  query productsAll(
469
470
  $search: String
@@ -518,7 +519,7 @@ export const GET_ALL_PRODUCTS = gql`
518
519
  }
519
520
  }
520
521
  }
521
- `;
522
+ `
522
523
  export const GET_ALL_FOOD_PRODUCTS = gql`
523
524
  query getFoodAllProduct(
524
525
  $search: String
@@ -555,7 +556,7 @@ export const GET_ALL_FOOD_PRODUCTS = gql`
555
556
  pDatMod
556
557
  }
557
558
  }
558
- `;
559
+ `
559
560
 
560
561
  export const EDIT_PRODUCT = gql`
561
562
  mutation editProductFoods($input: InputProductFood) {
@@ -564,7 +565,7 @@ export const EDIT_PRODUCT = gql`
564
565
  message
565
566
  }
566
567
  }
567
- `;
568
+ `
568
569
  export const SET_EDIT_STORE_NAME = gql`
569
570
  mutation setEditNameStore($StoreName: String) {
570
571
  setEditNameStore(StoreName: $StoreName) {
@@ -572,7 +573,7 @@ export const SET_EDIT_STORE_NAME = gql`
572
573
  message
573
574
  }
574
575
  }
575
- `;
576
+ `
576
577
  export const GET_ONE_PRODUCTS_FOOD = gql`
577
578
  query productFoodsOne($pId: ID) {
578
579
  productFoodsOne(pId: $pId) {
@@ -676,7 +677,7 @@ export const GET_ONE_PRODUCTS_FOOD = gql`
676
677
  }
677
678
  }
678
679
  }
679
- `;
680
+ `
680
681
 
681
682
  export const CREATE_FOOD_PRODUCT = gql`
682
683
  mutation newRegisterFoodProduct($input: FoodProductInput) {
@@ -685,7 +686,7 @@ export const CREATE_FOOD_PRODUCT = gql`
685
686
  message
686
687
  }
687
688
  }
688
- `;
689
+ `
689
690
  export const GET_BANNER_PROMO_DASHBOARD = gql`
690
691
  query getPromoStoreAdmin($min: Int, $max: Int) {
691
692
  getPromoStoreAdmin(min: $min, max: $max) {
@@ -699,7 +700,7 @@ export const GET_BANNER_PROMO_DASHBOARD = gql`
699
700
  updateAt
700
701
  }
701
702
  }
702
- `;
703
+ `
703
704
 
704
705
  export const CREATE_STORE_CALENDAR = gql`
705
706
  mutation setStoreSchedule($input: ITstoreSchedule!) {
@@ -708,7 +709,7 @@ export const CREATE_STORE_CALENDAR = gql`
708
709
  success
709
710
  }
710
711
  }
711
- `;
712
+ `
712
713
  export const DELETE_ONE_CAT_PRODUCTS = gql`
713
714
  mutation deleteCatOfProducts($idPc: ID!, $pState: Int) {
714
715
  deleteCatOfProducts(idPc: $idPc, pState: $pState) {
@@ -716,7 +717,7 @@ export const DELETE_ONE_CAT_PRODUCTS = gql`
716
717
  message
717
718
  }
718
719
  }
719
- `;
720
+ `
720
721
  export const DELETE_ONE_CAT_PRODUCTS_FINAL = gql`
721
722
  mutation deleteCatFinalOfProducts($idPc: ID, $withProduct: Boolean) {
722
723
  deleteCatFinalOfProducts(idPc: $idPc, withProduct: $withProduct) {
@@ -724,7 +725,7 @@ export const DELETE_ONE_CAT_PRODUCTS_FINAL = gql`
724
725
  message
725
726
  }
726
727
  }
727
- `;
728
+ `
728
729
  export const DELETE_EXTRA_PRODUCTS = gql`
729
730
  mutation deleteextraproductfoods($id: ID, $state: Int) {
730
731
  deleteextraproductfoods(id: $id, state: $state) {
@@ -732,7 +733,7 @@ export const DELETE_EXTRA_PRODUCTS = gql`
732
733
  message
733
734
  }
734
735
  }
735
- `;
736
+ `
736
737
  export const EDIT_EXTRA_PRODUCTS = gql`
737
738
  mutation editExtProductFoods($input: InputExtProductFood!) {
738
739
  editExtProductFoods(input: $input) {
@@ -740,7 +741,7 @@ export const EDIT_EXTRA_PRODUCTS = gql`
740
741
  message
741
742
  }
742
743
  }
743
- `;
744
+ `
744
745
  export const DELETE_CAT_EXTRA_PRODUCTS = gql`
745
746
  mutation DeleteExtProductFoodsOptional($opExPid: ID, $state: Int) {
746
747
  DeleteExtProductFoodsOptional(opExPid: $opExPid, state: $state) {
@@ -748,7 +749,7 @@ export const DELETE_CAT_EXTRA_PRODUCTS = gql`
748
749
  message
749
750
  }
750
751
  }
751
- `;
752
+ `
752
753
  export const DELETE_CAT_EXTRA_SUB_OPTIONAL_PRODUCTS = gql`
753
754
  mutation DeleteExtFoodSubsOptional($opSubExPid: ID, $state: Int) {
754
755
  DeleteExtFoodSubsOptional(opSubExPid: $opSubExPid, state: $state) {
@@ -756,7 +757,7 @@ export const DELETE_CAT_EXTRA_SUB_OPTIONAL_PRODUCTS = gql`
756
757
  message
757
758
  }
758
759
  }
759
- `;
760
+ `
760
761
  export const UPDATE_CAT_IN_PRODUCT = gql`
761
762
  mutation updatedCatWithProducts($input: LineItemsIdPro) {
762
763
  updatedCatWithProducts(input: $input) {
@@ -764,7 +765,7 @@ export const UPDATE_CAT_IN_PRODUCT = gql`
764
765
  message
765
766
  }
766
767
  }
767
- `;
768
+ `
768
769
  export const GET_ULTIMATE_CATEGORY_PRODUCTS = gql`
769
770
  query catProductsAll(
770
771
  $search: String
@@ -792,7 +793,7 @@ export const GET_ULTIMATE_CATEGORY_PRODUCTS = gql`
792
793
  pDatMod
793
794
  }
794
795
  }
795
- `;
796
+ `
796
797
  export const GET_ALL_EXTRA_PRODUCT = gql`
797
798
  query ExtProductFoodsAll($search: String, $min: Int, $max: Int, $pId: ID) {
798
799
  ExtProductFoodsAll(search: $search, min: $min, max: $max, pId: $pId) {
@@ -806,7 +807,7 @@ export const GET_ALL_EXTRA_PRODUCT = gql`
806
807
  pDatMod
807
808
  }
808
809
  }
809
- `;
810
+ `
810
811
  export const GET_ALL_CATEGORIES_WITH_PRODUCT = gql`
811
812
  query getCatProductsWithProduct(
812
813
  $search: String
@@ -870,7 +871,7 @@ export const GET_ALL_CATEGORIES_WITH_PRODUCT = gql`
870
871
  }
871
872
  }
872
873
  }
873
- `;
874
+ `
874
875
 
875
876
  export const REGISTER_TAGS_PRODUCT = gql`
876
877
  mutation registerTag($input: ITag) {
@@ -883,4 +884,4 @@ export const REGISTER_TAGS_PRODUCT = gql`
883
884
  aName
884
885
  }
885
886
  }
886
- `;
887
+ `
@@ -1,10 +1,8 @@
1
1
  import { useMutation } from '@apollo/client'
2
- import React from 'react'
3
2
  import { EDIT_PRODUCT } from './queriesStore'
4
3
 
5
4
  export const useEditProduct = () => {
6
- const [editProductFoods, { loading, error }] = useMutation(EDIT_PRODUCT)
5
+ const [editProductFoods, { loading, error }] = useMutation(EDIT_PRODUCT)
7
6
 
8
- return [editProductFoods, { loading: loading, error: error }]
7
+ return [editProductFoods, { loading, error }]
9
8
  }
10
-
@@ -3,92 +3,92 @@ import { useMutation } from '@apollo/client'
3
3
  import { REGISTER_TAGS_PRODUCT } from './queriesStore'
4
4
 
5
5
  export const useTagsProducts = () => {
6
- const [registerTag] = useMutation(REGISTER_TAGS_PRODUCT)
7
- const data = [
8
- {
9
- id: 1,
10
- tag: 'Bebida fría'
11
- },
12
- {
13
- id: 2,
14
- tag: 'Bebida caliente'
15
- },
16
- {
17
- id: 3,
18
- tag: 'Bebida alcohólica'
19
- },
20
- {
21
- id: 4,
22
- tag: 'Bebida sin alcohol'
23
- },
24
- {
25
- id: 5,
26
- tag: 'Entrante'
27
- },
28
- {
29
- id: 6,
30
- tag: 'Plato principal'
31
- },
32
- {
33
- id: 7,
34
- tag: 'Postre'
35
- },
36
- {
37
- id: 8,
38
- tag: 'Sopa'
39
- },
40
- {
41
- id: 9,
42
- tag: 'Ensalada'
43
- },
44
- {
45
- id: 10,
46
- tag: 'Mariscos'
47
- },
48
- ];
49
-
50
- const [tags, setTags] = useState({
51
- id: '',
52
- tag: ''
53
- })
6
+ const [registerTag] = useMutation(REGISTER_TAGS_PRODUCT)
7
+ const data = [
8
+ {
9
+ id: 1,
10
+ tag: 'Bebida fría'
11
+ },
12
+ {
13
+ id: 2,
14
+ tag: 'Bebida caliente'
15
+ },
16
+ {
17
+ id: 3,
18
+ tag: 'Bebida alcohólica'
19
+ },
20
+ {
21
+ id: 4,
22
+ tag: 'Bebida sin alcohol'
23
+ },
24
+ {
25
+ id: 5,
26
+ tag: 'Entrante'
27
+ },
28
+ {
29
+ id: 6,
30
+ tag: 'Plato principal'
31
+ },
32
+ {
33
+ id: 7,
34
+ tag: 'Postre'
35
+ },
36
+ {
37
+ id: 8,
38
+ tag: 'Sopa'
39
+ },
40
+ {
41
+ id: 9,
42
+ tag: 'Ensalada'
43
+ },
44
+ {
45
+ id: 10,
46
+ tag: 'Mariscos'
47
+ }
48
+ ]
54
49
 
55
- const handleAddTag = (id, tag) => {
56
- if (tags.id === id) {
57
- return setTags({
58
- id: '',
59
- tag: ''
60
- })
61
- }
50
+ const [tags, setTags] = useState({
51
+ id: '',
52
+ tag: ''
53
+ })
54
+
55
+ const handleAddTag = (id, tag) => {
56
+ if (tags.id === id) {
62
57
  return setTags({
63
- id,
64
- tag
58
+ id: '',
59
+ tag: ''
65
60
  })
66
61
  }
67
- const handleRegister = tag => {
68
- const {
69
- pId,
70
- idUser,
71
- idStore,
72
- nameTag
73
- } = tag || {}
62
+ return setTags({
63
+ id,
64
+ tag
65
+ })
66
+ }
67
+ const handleRegister = tag => {
68
+ const {
69
+ pId,
70
+ idUser,
71
+ idStore,
72
+ nameTag
73
+ } = tag || {}
74
74
 
75
- registerTag({
76
- variables: {
77
- input: {
78
- pId,
79
- idUser,
80
- nameTag,
81
- idStore
82
- }
75
+ registerTag({
76
+ variables: {
77
+ input: {
78
+ pId,
79
+ idUser,
80
+ nameTag,
81
+ idStore
83
82
  }
84
- }).catch(err => { return console.log({ message: `${err}`, duration: 7000 }) })
85
- }
86
- return {
87
- tags,
88
- error: false,
89
- data,
90
- loading: false,
91
- handleRegister,
92
- handleAddTag
93
- }
94
- }
83
+ }
84
+ }).catch(err => { return console.log({ message: `${err}`, duration: 7000 }) })
85
+ }
86
+ return {
87
+ tags,
88
+ error: false,
89
+ data,
90
+ loading: false,
91
+ handleRegister,
92
+ handleAddTag
93
+ }
94
+ }
@@ -1,3 +1,3 @@
1
- export * from './useProvidersCreateStore'
2
- export * from './useProvidersDataStore'
3
- export * from './queries'
1
+ export * from './useProvidersCreateStore'
2
+ export * from './useProvidersDataStore'
3
+ export * from './queries'
@@ -1,31 +1,31 @@
1
- import { gql } from '@apollo/client'
2
-
3
- export const CREATE_PROVIDERS = gql`
4
- mutation registerProviders($input: IProviders) {
5
- registerProviders(input: $input) {
6
- success
7
- message
8
- }
9
- }
10
- `
11
- export const GET_ALL_PROVIDERS = gql`
12
- query getAllProviders($idStore: ID,$search: String, $min: Int, $max: Int $fromDate: DateTime, $toDate: DateTime ) {
13
- getAllProviders(idStore: $idStore, search: $search, min: $min, max: $max, toDate: $toDate, fromDate: $fromDate) {
14
- idProvider
15
- idStore
16
- prImage
17
- prPathImage
18
- PrNit
19
- prName
20
- PrNumberPhone
21
- PrNumberIdentity
22
- PrAdres
23
- PrMail
24
- TotalBysPr
25
- TotalDeuda
26
- prState
27
- DatCre
28
- DatMod
29
- }
30
- }
31
- `
1
+ import { gql } from '@apollo/client'
2
+
3
+ export const CREATE_PROVIDERS = gql`
4
+ mutation registerProviders($input: IProviders) {
5
+ registerProviders(input: $input) {
6
+ success
7
+ message
8
+ }
9
+ }
10
+ `
11
+ export const GET_ALL_PROVIDERS = gql`
12
+ query getAllProviders($idStore: ID,$search: String, $min: Int, $max: Int $fromDate: DateTime, $toDate: DateTime ) {
13
+ getAllProviders(idStore: $idStore, search: $search, min: $min, max: $max, toDate: $toDate, fromDate: $fromDate) {
14
+ idProvider
15
+ idStore
16
+ prImage
17
+ prPathImage
18
+ PrNit
19
+ prName
20
+ PrNumberPhone
21
+ PrNumberIdentity
22
+ PrAdres
23
+ PrMail
24
+ TotalBysPr
25
+ TotalDeuda
26
+ prState
27
+ DatCre
28
+ DatMod
29
+ }
30
+ }
31
+ `
@@ -1,13 +1,12 @@
1
- import { useMutation } from "@apollo/client"
2
- import { CREATE_PROVIDERS } from "../queries"
3
-
4
- export const useProvidersCreateStore = ({ setAlertBox = () => { return } } = {}) => {
5
-
6
- const [registerProviders, { loading, error }] = useMutation(CREATE_PROVIDERS, {
7
- onCompleted: (data) => {
8
- setAlertBox({ message: `${data.registerProviders.message}` })
9
- }
10
- })
11
-
12
- return [registerProviders, { loading, error }]
13
- }
1
+ import { useMutation } from '@apollo/client'
2
+ import { CREATE_PROVIDERS } from '../queries'
3
+
4
+ export const useProvidersCreateStore = ({ setAlertBox = () => { } } = {}) => {
5
+ const [registerProviders, { loading, error }] = useMutation(CREATE_PROVIDERS, {
6
+ onCompleted: (data) => {
7
+ setAlertBox({ message: `${data.registerProviders.message}` })
8
+ }
9
+ })
10
+
11
+ return [registerProviders, { loading, error }]
12
+ }