npm-pkg-hook 1.12.3 → 1.12.7
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/index.cjs +20089 -0
- package/dist/index.js +19854 -0
- package/dist/index.mjs +19854 -0
- package/package.json +28 -6
- package/.babelrc +0 -0
- package/.env +0 -5
- package/.eslintrc.js +0 -38
- package/.eslintrc.json +0 -127
- package/.github/pull_request_template.md +0 -18
- package/.github/workflows/pepeline.yaml +0 -30
- package/expire.json +0 -1
- package/jsconfig.json +0 -28
- package/script.txt +0 -7
- package/src/config/client/errors.js +0 -26
- package/src/config/client/index.js +0 -1
- package/src/config/content/en.json +0 -5
- package/src/config/content/es.json +0 -5
- package/src/config/content/index.js +0 -16
- package/src/cookies/index.js +0 -3
- package/src/hooks/addTenMinutes/index.js +0 -14
- package/src/hooks/calculateLogLatHaversine/index.js +0 -30
- package/src/hooks/completeSchedules/index.js +0 -22
- package/src/hooks/convertToMilitaryTime/index.js +0 -14
- package/src/hooks/generateStoreURL/index.js +0 -38
- package/src/hooks/generateTemplate/index.js +0 -62
- package/src/hooks/getCardType/index.js +0 -24
- package/src/hooks/getCategoriesWithProduct/helpers/index.js +0 -7
- package/src/hooks/getCategoriesWithProduct/index.js +0 -62
- package/src/hooks/getGlobalSession/index.js +0 -49
- package/src/hooks/getSession/index.js +0 -18
- package/src/hooks/getTodayTimestamps/index.js +0 -64
- package/src/hooks/getTotalHours/index.js +0 -48
- package/src/hooks/handleLogin/index.js +0 -10
- package/src/hooks/index.ts +0 -146
- package/src/hooks/isTokenExpired/index.js +0 -17
- package/src/hooks/newMessageSubscription/index.js +0 -28
- package/src/hooks/newStoreOrderSubscription/index.js +0 -26
- package/src/hooks/statusOpenStores/helpers/index.js +0 -101
- package/src/hooks/statusOpenStores/index.js +0 -156
- package/src/hooks/updateExtProductFoodsOptional/index.js +0 -40
- package/src/hooks/useAcumulateDate/index.js +0 -16
- package/src/hooks/useAllStoresPendingToRegister/index.js +0 -34
- package/src/hooks/useAmountInput/index.ts +0 -117
- package/src/hooks/useAnimationFrame/index.js +0 -45
- package/src/hooks/useAnimationText/index.jsx +0 -31
- package/src/hooks/useAsideCart/helpers/index.js +0 -22
- package/src/hooks/useAsideCart/index.js +0 -214
- package/src/hooks/useAsideCart/queries.js +0 -10
- package/src/hooks/useBanner/index.js +0 -19
- package/src/hooks/useCart/index.js +0 -2
- package/src/hooks/useCart/queries.js +0 -174
- package/src/hooks/useCart/useCart/helpers/index.js +0 -75
- package/src/hooks/useCart/useCart/index.js +0 -412
- package/src/hooks/useCart/useGetCart/index.js +0 -33
- package/src/hooks/useCatWithProduct/index.js +0 -48
- package/src/hooks/useCatWithProduct/queries.js +0 -200
- package/src/hooks/useCatWithProductClient/index.js +0 -56
- package/src/hooks/useCatWithProductClient/queries.js +0 -56
- package/src/hooks/useCategoriesProduct/index.js +0 -13
- package/src/hooks/useCategoriesProduct/queries.js +0 -16
- package/src/hooks/useCategoryInStore/index.js +0 -100
- package/src/hooks/useCategoryInStore/queries.js +0 -78
- package/src/hooks/useCategoryStore/index.js +0 -7
- package/src/hooks/useCategoryStore/queries.js +0 -16
- package/src/hooks/useChartData/index.js +0 -170
- package/src/hooks/useChartData/useChartData/index.js +0 -199
- package/src/hooks/useChartData/useChartDataAllOrders/index.js +0 -94
- package/src/hooks/useChatRoomSubscription/index.js +0 -28
- package/src/hooks/useCheckbox/index.js +0 -115
- package/src/hooks/useCities/index.js +0 -13
- package/src/hooks/useCities/queries.js +0 -12
- package/src/hooks/useClients/index.js +0 -96
- package/src/hooks/useClients/queries.js +0 -212
- package/src/hooks/useColorByLetters/helpers/alea.js +0 -54
- package/src/hooks/useColorByLetters/helpers/colors.js +0 -45
- package/src/hooks/useColorByLetters/helpers/index.js +0 -18
- package/src/hooks/useColorByLetters/helpers/mersenne_twister.js +0 -118
- package/src/hooks/useColorByLetters/index.js +0 -27
- package/src/hooks/useConnection/index.js +0 -24
- package/src/hooks/useCountries/index.js +0 -19
- package/src/hooks/useCountries/queries.js +0 -12
- package/src/hooks/useCreateDeliveryTime/index.js +0 -51
- package/src/hooks/useCreateOrderStatusType/index.ts +0 -132
- package/src/hooks/useCreateProduct/helpers/index.js +0 -23
- package/src/hooks/useCreateProduct/helpers/manageCacheDataCatProduct/index.js +0 -52
- package/src/hooks/useCreateProduct/helpers/useEditImageProduct/index.js +0 -176
- package/src/hooks/useCreateProduct/index.js +0 -334
- package/src/hooks/useCreateStorePendingToRegister/index.js +0 -13
- package/src/hooks/useCreateStorePendingToRegister/queries.js +0 -10
- package/src/hooks/useDashboardComponents/index.js +0 -50
- package/src/hooks/useDeleteExtraProductFoods/index.js +0 -12
- package/src/hooks/useDeleteSubProductOptional/index.js +0 -30
- package/src/hooks/useDeleteSubProductOptional/queries.js +0 -10
- package/src/hooks/useDeliveryTime/index.js +0 -27
- package/src/hooks/useDepartments/index.js +0 -13
- package/src/hooks/useDepartments/queries.js +0 -13
- package/src/hooks/useDessert/helpers/index.js +0 -51
- package/src/hooks/useDessert/index.js +0 -525
- package/src/hooks/useDessertWithPrice/helpers/index.js +0 -76
- package/src/hooks/useDessertWithPrice/index.js +0 -373
- package/src/hooks/useDessertWithPrice/queries.js +0 -18
- package/src/hooks/useDevWS/index.ts +0 -53
- package/src/hooks/useDevices/index.js +0 -2
- package/src/hooks/useDevices/queries.js +0 -28
- package/src/hooks/useDevices/useGetDevices.js +0 -28
- package/src/hooks/useDevices/useRegisterDevices.js +0 -75
- package/src/hooks/useDownloadReports/helpers/downloadFileFromResponse.ts +0 -21
- package/src/hooks/useDownloadReports/index.ts +0 -2
- package/src/hooks/useDownloadReports/useDownloadReportByDay/index.ts +0 -103
- package/src/hooks/useDownloadReports/useGetReportByDateRange/index.ts +0 -115
- package/src/hooks/useDrag/index.js +0 -63
- package/src/hooks/useDropzone/index.js +0 -94
- package/src/hooks/useDynamicAuth/index.js +0 -13
- package/src/hooks/useDynamicAuth/queries.js +0 -24
- package/src/hooks/useEditCategory/index.js +0 -41
- package/src/hooks/useEditOneExtProductFoodOptional/index.js +0 -28
- package/src/hooks/useEditOneExtProductFoodOptional/queries.js +0 -16
- package/src/hooks/useEditSubProductOptional/index.js +0 -11
- package/src/hooks/useEditSubProductOptional/queries.js +0 -10
- package/src/hooks/useEmployee/index.js +0 -17
- package/src/hooks/useEmployee/queries.js +0 -85
- package/src/hooks/useEmployee/useCreateEmployee.js +0 -86
- package/src/hooks/useEvent/index.js +0 -34
- package/src/hooks/useFavoriteStores/index.js +0 -29
- package/src/hooks/useFavoriteStores/queries.js +0 -54
- package/src/hooks/useFetchJson/index.js +0 -25
- package/src/hooks/useFetchMoreInteractions/index.jsx +0 -39
- package/src/hooks/useFingerprintjs/index.js +0 -172
- package/src/hooks/useFormTools/index.js +0 -116
- package/src/hooks/useFormatDate/index.js +0 -86
- package/src/hooks/useFormatNumberPhone/index.js +0 -23
- package/src/hooks/useFullScreenMode/index.js +0 -65
- package/src/hooks/useGenerateNumberArray/index.js +0 -17
- package/src/hooks/useGetAllLocationUser/index.js +0 -12
- package/src/hooks/useGetAllLocationUser/queries.js +0 -44
- package/src/hooks/useGetCookies/index.js +0 -43
- package/src/hooks/useGetExtProductFoodsSubOptionalAll/index.js +0 -14
- package/src/hooks/useGetFoodRecomended/index.js +0 -32
- package/src/hooks/useGetFoodRecomended/queries.js +0 -47
- package/src/hooks/useGetMessagesToRoom/index.js +0 -23
- package/src/hooks/useGetMinPrice/index.js +0 -12
- package/src/hooks/useGetMinPrice/queries.js +0 -7
- package/src/hooks/useGetOneStoreRating/index.js +0 -40
- package/src/hooks/useGetOneStoreRating/queries.js +0 -18
- package/src/hooks/useGetSalesAmountToday/index.js +0 -31
- package/src/hooks/useGetStoreCookie/index.js +0 -21
- package/src/hooks/useGoogleLogin/index.js +0 -160
- package/src/hooks/useGoogleLogin/loadScript.js +0 -15
- package/src/hooks/useGoogleLogin/removeScript.js +0 -7
- package/src/hooks/useHover/index.js +0 -29
- package/src/hooks/useImageOptimization/index.js +0 -28
- package/src/hooks/useImageUploaderProduct/helper/canvasUtils.ts +0 -130
- package/src/hooks/useImageUploaderProduct/helper/getOrientation.ts +0 -53
- package/src/hooks/useImageUploaderProduct/helper/index.ts +0 -5
- package/src/hooks/useImageUploaderProduct/index.ts +0 -292
- package/src/hooks/useImageWeight/index.js +0 -51
- package/src/hooks/useImagesStore/index.js +0 -225
- package/src/hooks/useImagesStore/queries.js +0 -193
- package/src/hooks/useImagesStore/utils/index.js +0 -4
- package/src/hooks/useIncomingOrders/index.js +0 -10
- package/src/hooks/useIncomingOrders/queries.js +0 -87
- package/src/hooks/useInnerHtml/index.js +0 -39
- package/src/hooks/useIntersection/index.js +0 -84
- package/src/hooks/useInventory/index.js +0 -2
- package/src/hooks/useInventory/queries.js +0 -58
- package/src/hooks/useInventory/useGetProductsInStock.js +0 -15
- package/src/hooks/useInventory/useUpdateManageStock.js +0 -41
- package/src/hooks/useKeypress/index.js +0 -28
- package/src/hooks/useLazyScript/index.js +0 -71
- package/src/hooks/useLocalBackendIp/index.js +0 -34
- package/src/hooks/useLocalSorage/index.js +0 -36
- package/src/hooks/useLocationManager/index.js +0 -63
- package/src/hooks/useLocationNavigate/index.js +0 -54
- package/src/hooks/useLoginEmployeeInStore/index.js +0 -38
- package/src/hooks/useLogout/helpers/BroadcastChannel.js +0 -31
- package/src/hooks/useLogout/helpers/apiBaseUrl.js +0 -8
- package/src/hooks/useLogout/helpers/fetchData.js +0 -28
- package/src/hooks/useLogout/helpers/getCsrfToken.js +0 -30
- package/src/hooks/useLogout/helpers/index.js +0 -57
- package/src/hooks/useLogout/helpers/logger.js +0 -70
- package/src/hooks/useLogout/helpers/parseUrl.js +0 -36
- package/src/hooks/useLogout/index.js +0 -96
- package/src/hooks/useManageNewOrder/helpers/index.js +0 -45
- package/src/hooks/useManageNewOrder/helpers/mock.js +0 -0
- package/src/hooks/useManageNewOrder/index.js +0 -102
- package/src/hooks/useManageQueryParams/index.js +0 -40
- package/src/hooks/useMobile/index.js +0 -65
- package/src/hooks/useModules/helpers/index.js +0 -1
- package/src/hooks/useModules/helpers/validateModules.js +0 -29
- package/src/hooks/useModules/index.js +0 -58
- package/src/hooks/useMouse/index.ts +0 -50
- package/src/hooks/useMutateHeight/index.js +0 -36
- package/src/hooks/useOrderClient/index.js +0 -5
- package/src/hooks/useOrderStatusTypes/index.ts +0 -2
- package/src/hooks/useOrderStatusTypes/useOrderStatusTypes/index.ts +0 -133
- package/src/hooks/useOrderStatusTypes/useUpdateOrderStatusPriorities/index.ts +0 -97
- package/src/hooks/useOrders/index.js +0 -3
- package/src/hooks/useOrders/queries.js +0 -89
- package/src/hooks/useOrders/useChangeOrderState/index.ts +0 -125
- package/src/hooks/useOrders/useOrdersFromStore/index.ts +0 -77
- package/src/hooks/usePWAInstall/index.js +0 -38
- package/src/hooks/usePortFetcher/index.ts +0 -33
- package/src/hooks/useProductsFood/index.js +0 -253
- package/src/hooks/useProductsFood/queriesStore.js +0 -964
- package/src/hooks/useProductsFood/useEditProduct.js +0 -48
- package/src/hooks/useProductsFood/usetagsProducts.js +0 -98
- package/src/hooks/useProviders/index.js +0 -3
- package/src/hooks/useProviders/queries.js +0 -31
- package/src/hooks/useProviders/useProvidersCreateStore/index.js +0 -12
- package/src/hooks/useProviders/useProvidersDataStore/index.js +0 -24
- package/src/hooks/useProvidersStore/index.js +0 -24
- package/src/hooks/useProvidersStore/queries.js +0 -31
- package/src/hooks/usePushNotificationOrder/index.js +0 -52
- package/src/hooks/usePushNotifications/helpers/index.js +0 -114
- package/src/hooks/usePushNotifications/index.js +0 -149
- package/src/hooks/useQueryLocationsMap/index.js +0 -19
- package/src/hooks/useQueryLocationsMap/queries.js +0 -40
- package/src/hooks/useRatingArrayData/index.js +0 -54
- package/src/hooks/useRatingArrayData/queries.js +0 -19
- package/src/hooks/useReactToPrint/index.js +0 -1223
- package/src/hooks/useRemoveExtraProductFoodsOptional/index.js +0 -23
- package/src/hooks/useRemoveExtraProductFoodsOptional/queries.js +0 -48
- package/src/hooks/useReport/index.js +0 -47
- package/src/hooks/useReport/queries.js +0 -123
- package/src/hooks/useRestaurant/helpers/index.js +0 -24
- package/src/hooks/useRestaurant/helpers/manageStatusOpen.js +0 -26
- package/src/hooks/useRestaurant/index.js +0 -69
- package/src/hooks/useRestaurant/queries.js +0 -81
- package/src/hooks/useRoads/index.js +0 -19
- package/src/hooks/useRoads/queries.js +0 -13
- package/src/hooks/useRoles/index.js +0 -4
- package/src/hooks/useRoles/queries.js +0 -70
- package/src/hooks/useRoles/useCreateRole.js +0 -37
- package/src/hooks/useRoles/useGetRoles.js +0 -36
- package/src/hooks/useRoles/useRemoveRoles.js +0 -40
- package/src/hooks/useRoles/useUpdateRolesPriority.js +0 -44
- package/src/hooks/useSales/helpers/index.js +0 -55
- package/src/hooks/useSales/index.js +0 -1381
- package/src/hooks/useSales/queries.js +0 -424
- package/src/hooks/useSales/useGetAllSales/index.js +0 -25
- package/src/hooks/useSales/useGetSale.js +0 -13
- package/src/hooks/useSales/useTotalSales.js +0 -23
- package/src/hooks/useSaveAvailableProduct/helpers/index.js +0 -38
- package/src/hooks/useSaveAvailableProduct/index.js +0 -31
- package/src/hooks/useSaveAvailableProduct/queries.js +0 -10
- package/src/hooks/useSaveLocation/index.js +0 -16
- package/src/hooks/useSaveLocation/queries.js +0 -19
- package/src/hooks/useSchedule/index.js +0 -78
- package/src/hooks/useSchedule/index.jsx +0 -22
- package/src/hooks/useSchedule/queries.js +0 -43
- package/src/hooks/useScheduleData/index.js +0 -123
- package/src/hooks/useScroll/index.js +0 -56
- package/src/hooks/useScrollRotate/index.js +0 -16
- package/src/hooks/useSetImageProducts/index.js +0 -57
- package/src/hooks/useSetImageProducts/queries.js +0 -18
- package/src/hooks/useSetSession/index.js +0 -44
- package/src/hooks/useSetState/index.js +0 -24
- package/src/hooks/useSetupSchedule/helpers/index.js +0 -85
- package/src/hooks/useSetupSchedule/index.js +0 -272
- package/src/hooks/useStatusOpenStore/helpers/index.js +0 -101
- package/src/hooks/useStatusOpenStore/index.js +0 -179
- package/src/hooks/useStatusOrdersClient/helpers/index.js +0 -14
- package/src/hooks/useStatusOrdersClient/index.js +0 -17
- package/src/hooks/useStatusOrdersClient/queries.js +0 -80
- package/src/hooks/useStockMovements/helpers/index.js +0 -16
- package/src/hooks/useStockMovements/index.js +0 -38
- package/src/hooks/useStore/index.js +0 -80
- package/src/hooks/useStore/queries.js +0 -163
- package/src/hooks/useStoreCalendar/index.js +0 -5
- package/src/hooks/useStoreContacts/index.js +0 -47
- package/src/hooks/useStoreContacts/queries.js +0 -48
- package/src/hooks/useStoreTable/index.js +0 -2
- package/src/hooks/useStoreTable/queries.js +0 -47
- package/src/hooks/useStoreTable/useStoreTableCreate.js +0 -76
- package/src/hooks/useStoreTable/useStoreTables.js +0 -14
- package/src/hooks/useSubscriptionValidation/index.js +0 -41
- package/src/hooks/useTagProducts/index.ts +0 -3
- package/src/hooks/useTagProducts/useDeleteOneTag.ts +0 -106
- package/src/hooks/useTagProducts/useGetAllTags.ts +0 -68
- package/src/hooks/useTagProducts/useRegisterMultipleTags.ts +0 -156
- package/src/hooks/useTimeAgo/useTimeAgo.js +0 -39
- package/src/hooks/useTokenCards/index.js +0 -41
- package/src/hooks/useTopProductsMovements/index.js +0 -27
- package/src/hooks/useTotalAllSales/index.js +0 -25
- package/src/hooks/useTotalProductsInStock/index.js +0 -23
- package/src/hooks/useTotalProductsSold/index.js +0 -23
- package/src/hooks/useTotalProductsSolded/index.js +0 -20
- package/src/hooks/useUpdateCart/index.js +0 -130
- package/src/hooks/useUpdateCartCookie/index.js +0 -43
- package/src/hooks/useUpdateDashboardComponent/index.ts +0 -91
- package/src/hooks/useUpdateExistingOrders/index.js +0 -85
- package/src/hooks/useUpdateExtProductFoodsSubOptional/index.js +0 -60
- package/src/hooks/useUpdateModuleOrder/index.js +0 -37
- package/src/hooks/useUpdateMultipleExtProduct/index.js +0 -33
- package/src/hooks/useUpdateMultipleExtProduct/queries.js +0 -33
- package/src/hooks/useUpdateMultipleProducts/index.js +0 -80
- package/src/hooks/useUpdateMultipleProducts/queries.js +0 -51
- package/src/hooks/useUploadProducts/helpers/index.js +0 -1
- package/src/hooks/useUploadProducts/helpers/parseNumber.js +0 -37
- package/src/hooks/useUploadProducts/helpers/validateProductDataExcel.js +0 -73
- package/src/hooks/useUploadProducts/index.js +0 -422
- package/src/hooks/useUpsertGoal/index.js +0 -68
- package/src/hooks/useUser/index.js +0 -23
- package/src/hooks/useUser/queries.js +0 -131
- package/src/hooks/useWeeklyStockMovement/helpers/index.js +0 -32
- package/src/hooks/useWeeklyStockMovement/index.js +0 -51
- package/src/hooks/useWindowSize/index.js +0 -38
- package/src/index.jsx +0 -9
- package/src/mock/dessert/index.js +0 -16
- package/src/mock/index.js +0 -1
- package/src/security/index.js +0 -1
- package/src/services/index.js +0 -0
- package/src/utils/UtilDateRange.js +0 -31
- package/src/utils/index.js +0 -306
- package/tsconfig.json +0 -5
|
@@ -1,424 +0,0 @@
|
|
|
1
|
-
import { gql } from '@apollo/client'
|
|
2
|
-
|
|
3
|
-
export const GET_ALL_SALES = gql`
|
|
4
|
-
query getAllSalesStore(
|
|
5
|
-
$idStore: ID
|
|
6
|
-
$search: String
|
|
7
|
-
$min: Int
|
|
8
|
-
$max: Int
|
|
9
|
-
$fromDate: String
|
|
10
|
-
$toDate: String
|
|
11
|
-
) {
|
|
12
|
-
getAllSalesStore(
|
|
13
|
-
idStore: $idStore
|
|
14
|
-
search: $search
|
|
15
|
-
min: $min
|
|
16
|
-
max: $max
|
|
17
|
-
toDate: $toDate
|
|
18
|
-
fromDate: $fromDate
|
|
19
|
-
) {
|
|
20
|
-
totalProductsPrice
|
|
21
|
-
pDatCre
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
`
|
|
25
|
-
|
|
26
|
-
export const GET_ALL_COUNT_SALES = gql`
|
|
27
|
-
query getTodaySales {
|
|
28
|
-
getTodaySales
|
|
29
|
-
}
|
|
30
|
-
`
|
|
31
|
-
export const GET_ALL_SALES_STATISTICS = gql`
|
|
32
|
-
query getAllSalesStoreStatistic(
|
|
33
|
-
$idStore: ID
|
|
34
|
-
$search: String
|
|
35
|
-
$min: Int
|
|
36
|
-
$max: Int
|
|
37
|
-
$fromDate: DateTime
|
|
38
|
-
$toDate: DateTime
|
|
39
|
-
) {
|
|
40
|
-
getAllSalesStoreStatistic(
|
|
41
|
-
idStore: $idStore
|
|
42
|
-
search: $search
|
|
43
|
-
min: $min
|
|
44
|
-
max: $max
|
|
45
|
-
toDate: $toDate
|
|
46
|
-
fromDate: $fromDate
|
|
47
|
-
) {
|
|
48
|
-
pdpId
|
|
49
|
-
idStore
|
|
50
|
-
pCodeRef
|
|
51
|
-
payMethodPState
|
|
52
|
-
pPRecoger
|
|
53
|
-
totalProductsPrice
|
|
54
|
-
pSState
|
|
55
|
-
pDatCre
|
|
56
|
-
locationUser
|
|
57
|
-
pDatMod
|
|
58
|
-
getAllPedidoStore {
|
|
59
|
-
pdpId
|
|
60
|
-
pId
|
|
61
|
-
idStore
|
|
62
|
-
ShoppingCard
|
|
63
|
-
pCodeRef
|
|
64
|
-
pPStateP
|
|
65
|
-
payMethodPState
|
|
66
|
-
pPRecoger
|
|
67
|
-
pDatCre
|
|
68
|
-
pDatMod
|
|
69
|
-
getAllShoppingCard {
|
|
70
|
-
ShoppingCard
|
|
71
|
-
comments
|
|
72
|
-
cantProducts
|
|
73
|
-
pId
|
|
74
|
-
productFood {
|
|
75
|
-
pId
|
|
76
|
-
carProId
|
|
77
|
-
colorId
|
|
78
|
-
idStore
|
|
79
|
-
pName
|
|
80
|
-
ProPrice
|
|
81
|
-
ProDescuento
|
|
82
|
-
ProDescription
|
|
83
|
-
ValueDelivery
|
|
84
|
-
ProImage
|
|
85
|
-
ProStar
|
|
86
|
-
pState
|
|
87
|
-
pDatCre
|
|
88
|
-
pDatMod
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
`
|
|
95
|
-
|
|
96
|
-
export const GET_ONE_SALES = gql`
|
|
97
|
-
query getOneSalesStore($pCodeRef: String) {
|
|
98
|
-
getOneSalesStore(pCodeRef: $pCodeRef) {
|
|
99
|
-
pdpId
|
|
100
|
-
idStore
|
|
101
|
-
pCodeRef
|
|
102
|
-
payMethodPState
|
|
103
|
-
pPRecoger
|
|
104
|
-
totalProductsPrice
|
|
105
|
-
pSState
|
|
106
|
-
pDatCre
|
|
107
|
-
locationUser
|
|
108
|
-
pDatMod
|
|
109
|
-
getAllPedidoStore{
|
|
110
|
-
pdpId
|
|
111
|
-
pId
|
|
112
|
-
idStore
|
|
113
|
-
ShoppingCard
|
|
114
|
-
pCodeRef
|
|
115
|
-
pPStateP
|
|
116
|
-
payMethodPState
|
|
117
|
-
pPRecoger
|
|
118
|
-
pDatCre
|
|
119
|
-
pDatMod
|
|
120
|
-
getAllShoppingCard {
|
|
121
|
-
ShoppingCard
|
|
122
|
-
comments
|
|
123
|
-
cantProducts
|
|
124
|
-
pId
|
|
125
|
-
productFood{
|
|
126
|
-
pId
|
|
127
|
-
carProId
|
|
128
|
-
colorId
|
|
129
|
-
idStore
|
|
130
|
-
pName
|
|
131
|
-
ProPrice
|
|
132
|
-
ProDescuento
|
|
133
|
-
ProDescription
|
|
134
|
-
ValueDelivery
|
|
135
|
-
ProImage
|
|
136
|
-
ProStar
|
|
137
|
-
pState
|
|
138
|
-
pDatCre
|
|
139
|
-
pDatMod
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
`
|
|
146
|
-
|
|
147
|
-
export const CREATE_CLIENTS = gql`
|
|
148
|
-
mutation createClients($input: IClients) {
|
|
149
|
-
createClients(input: $input) {
|
|
150
|
-
cliId
|
|
151
|
-
idStore
|
|
152
|
-
idUser
|
|
153
|
-
clState
|
|
154
|
-
ClientAddress
|
|
155
|
-
clientNumber
|
|
156
|
-
ccClient
|
|
157
|
-
gender
|
|
158
|
-
clientLastName
|
|
159
|
-
clientName
|
|
160
|
-
createAt
|
|
161
|
-
updateAt
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
`
|
|
165
|
-
export const DELETE_ONE_CLIENTS = gql`
|
|
166
|
-
mutation deleteClient($cliId: ID, $clState: Int!) {
|
|
167
|
-
deleteClient(cliId: $cliId, clState: $clState) {
|
|
168
|
-
success
|
|
169
|
-
message
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
`
|
|
173
|
-
export const GET_ALL_CLIENTS = gql`
|
|
174
|
-
query getAllClients(
|
|
175
|
-
$idStore: ID
|
|
176
|
-
$cId: ID
|
|
177
|
-
$dId: ID
|
|
178
|
-
$ctId: ID
|
|
179
|
-
$search: String
|
|
180
|
-
$min: Int
|
|
181
|
-
$max: Int
|
|
182
|
-
$fromDate: DateTime
|
|
183
|
-
$toDate: DateTime
|
|
184
|
-
) {
|
|
185
|
-
getAllClients(
|
|
186
|
-
idStore: $idStore
|
|
187
|
-
cId: $cId
|
|
188
|
-
dId: $dId
|
|
189
|
-
ctId: $ctId
|
|
190
|
-
search: $search
|
|
191
|
-
min: $min
|
|
192
|
-
max: $max
|
|
193
|
-
fromDate: $fromDate
|
|
194
|
-
toDate: $toDate
|
|
195
|
-
) {
|
|
196
|
-
cliId
|
|
197
|
-
idStore
|
|
198
|
-
gender
|
|
199
|
-
# idUser
|
|
200
|
-
clState
|
|
201
|
-
clientNumber
|
|
202
|
-
ccClient
|
|
203
|
-
clientLastName
|
|
204
|
-
clientName
|
|
205
|
-
ClientAddress
|
|
206
|
-
createAt
|
|
207
|
-
updateAt
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
`
|
|
211
|
-
export const GET_ONE_CLIENT = gql`
|
|
212
|
-
query getOneClients($cliId: ID) {
|
|
213
|
-
getOneClients(cliId: $cliId) {
|
|
214
|
-
cliId
|
|
215
|
-
idStore
|
|
216
|
-
idUser
|
|
217
|
-
clState
|
|
218
|
-
clientNumber
|
|
219
|
-
ClientAddress
|
|
220
|
-
gender
|
|
221
|
-
ccClient
|
|
222
|
-
clientLastName
|
|
223
|
-
clientName
|
|
224
|
-
createAt
|
|
225
|
-
updateAt
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
`
|
|
229
|
-
|
|
230
|
-
export const CREATE_SHOPPING_CARD = gql`
|
|
231
|
-
mutation registerShoppingCard(
|
|
232
|
-
$input: IShoppingCard
|
|
233
|
-
$idSubArray: IID_SUB_ITEMS
|
|
234
|
-
) {
|
|
235
|
-
registerShoppingCard(input: $input, idSubArray: $idSubArray) {
|
|
236
|
-
ShoppingCard
|
|
237
|
-
id
|
|
238
|
-
pId
|
|
239
|
-
subProductsId
|
|
240
|
-
ShoppingCardRefCode
|
|
241
|
-
uuid
|
|
242
|
-
discountCardProduct
|
|
243
|
-
idUser
|
|
244
|
-
cName
|
|
245
|
-
idStore
|
|
246
|
-
cState
|
|
247
|
-
cDatCre
|
|
248
|
-
cDatMod
|
|
249
|
-
csDescription
|
|
250
|
-
cantProducts
|
|
251
|
-
comments
|
|
252
|
-
# idSubArray
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
`
|
|
256
|
-
export const GET_ONE_SALE = gql`
|
|
257
|
-
query getOneSalesStore($pCodeRef: String) {
|
|
258
|
-
getOneSalesStore(pCodeRef: $pCodeRef) {
|
|
259
|
-
message
|
|
260
|
-
message
|
|
261
|
-
errors {
|
|
262
|
-
message
|
|
263
|
-
path
|
|
264
|
-
type
|
|
265
|
-
context {
|
|
266
|
-
key
|
|
267
|
-
label
|
|
268
|
-
limit
|
|
269
|
-
value
|
|
270
|
-
__typename
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
data {
|
|
274
|
-
change
|
|
275
|
-
channel
|
|
276
|
-
id
|
|
277
|
-
locationUser
|
|
278
|
-
pCodeRef
|
|
279
|
-
pdpId
|
|
280
|
-
ppState
|
|
281
|
-
ppState
|
|
282
|
-
shoppingCartRefCode
|
|
283
|
-
pSState
|
|
284
|
-
totalProductsPrice
|
|
285
|
-
unidProducts
|
|
286
|
-
updatedAt
|
|
287
|
-
createdAt
|
|
288
|
-
__typename
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
`
|
|
293
|
-
|
|
294
|
-
export const CREATE_SHOPPING_CARD_TO_USER_STORE = gql`
|
|
295
|
-
mutation registerSalesStore(
|
|
296
|
-
$input: [IShoppingCart]
|
|
297
|
-
$id: ID
|
|
298
|
-
$tableId: ID
|
|
299
|
-
$discount: Int
|
|
300
|
-
$idStore: ID
|
|
301
|
-
$pCodeRef: String
|
|
302
|
-
$change: Float
|
|
303
|
-
$shoppingCartRefCode: String
|
|
304
|
-
$payMethodPState: Int
|
|
305
|
-
$pickUp: Int
|
|
306
|
-
$totalProductsPrice: Float
|
|
307
|
-
$valueDelivery: Float
|
|
308
|
-
$idSubArray: IID_SUB_ITEMS
|
|
309
|
-
) {
|
|
310
|
-
registerSalesStore(
|
|
311
|
-
input: $input
|
|
312
|
-
id: $id
|
|
313
|
-
tableId: $tableId
|
|
314
|
-
discount: $discount
|
|
315
|
-
shoppingCartRefCode: $shoppingCartRefCode
|
|
316
|
-
idStore: $idStore
|
|
317
|
-
pCodeRef: $pCodeRef
|
|
318
|
-
change: $change
|
|
319
|
-
|
|
320
|
-
payMethodPState: $payMethodPState
|
|
321
|
-
pickUp: $pickUp
|
|
322
|
-
totalProductsPrice: $totalProductsPrice
|
|
323
|
-
valueDelivery: $valueDelivery
|
|
324
|
-
idSubArray: $idSubArray
|
|
325
|
-
) {
|
|
326
|
-
success
|
|
327
|
-
message
|
|
328
|
-
errors {
|
|
329
|
-
path
|
|
330
|
-
message
|
|
331
|
-
type
|
|
332
|
-
context {
|
|
333
|
-
limit
|
|
334
|
-
value
|
|
335
|
-
label
|
|
336
|
-
key
|
|
337
|
-
__typename
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
data {
|
|
341
|
-
pCodeRef
|
|
342
|
-
idStore
|
|
343
|
-
id
|
|
344
|
-
channel
|
|
345
|
-
payMethodPState
|
|
346
|
-
pSState
|
|
347
|
-
createdAt
|
|
348
|
-
updatedAt
|
|
349
|
-
unidProducts
|
|
350
|
-
totalProductsPrice
|
|
351
|
-
getOneStore {
|
|
352
|
-
idStore
|
|
353
|
-
cId
|
|
354
|
-
dId
|
|
355
|
-
catStore
|
|
356
|
-
scheduleOpenAll
|
|
357
|
-
dailyGoal
|
|
358
|
-
deliveryTimeMinutes
|
|
359
|
-
}
|
|
360
|
-
getUser {
|
|
361
|
-
id
|
|
362
|
-
name
|
|
363
|
-
email
|
|
364
|
-
createdAt
|
|
365
|
-
updatedAt
|
|
366
|
-
__typename
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
`
|
|
372
|
-
|
|
373
|
-
export const GET_ALL_ORDER = gql`
|
|
374
|
-
query getAllOrderStoreFinal($idStore: ID, $search: String, $min: Int, $max: Int, $statusOrder: Int) {
|
|
375
|
-
getAllOrderStoreFinal(idStore: $idStore, search: $search, min: $min, max: $max, statusOrder: $statusOrder) {
|
|
376
|
-
pdpId
|
|
377
|
-
idStore
|
|
378
|
-
pCodeRef
|
|
379
|
-
payMethodPState
|
|
380
|
-
pPRecoger
|
|
381
|
-
totalProductsPrice
|
|
382
|
-
pSState
|
|
383
|
-
pDatCre
|
|
384
|
-
channel
|
|
385
|
-
locationUser
|
|
386
|
-
pDatMod
|
|
387
|
-
getAllPedidoStore{
|
|
388
|
-
pdpId
|
|
389
|
-
pId
|
|
390
|
-
idStore
|
|
391
|
-
ShoppingCard
|
|
392
|
-
pCodeRef
|
|
393
|
-
pPStateP
|
|
394
|
-
payMethodPState
|
|
395
|
-
pPRecoger
|
|
396
|
-
pDatCre
|
|
397
|
-
pDatMod
|
|
398
|
-
getAllShoppingCard {
|
|
399
|
-
ShoppingCard
|
|
400
|
-
priceProduct
|
|
401
|
-
comments
|
|
402
|
-
cantProducts
|
|
403
|
-
pId
|
|
404
|
-
productFood{
|
|
405
|
-
pId
|
|
406
|
-
carProId
|
|
407
|
-
colorId
|
|
408
|
-
idStore
|
|
409
|
-
pName
|
|
410
|
-
ProPrice
|
|
411
|
-
ProDescuento
|
|
412
|
-
ProDescription
|
|
413
|
-
ValueDelivery
|
|
414
|
-
ProImage
|
|
415
|
-
ProStar
|
|
416
|
-
pState
|
|
417
|
-
pDatCre
|
|
418
|
-
pDatMod
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
`
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { useQuery } from '@apollo/client'
|
|
2
|
-
import { GET_ALL_SALES_STATISTICS } from '../queries'
|
|
3
|
-
|
|
4
|
-
export const useGetAllSales = ({
|
|
5
|
-
fromDate = '',
|
|
6
|
-
toDate = ''
|
|
7
|
-
} = {}) => {
|
|
8
|
-
const {
|
|
9
|
-
data,
|
|
10
|
-
loading,
|
|
11
|
-
error
|
|
12
|
-
} = useQuery(GET_ALL_SALES_STATISTICS, {
|
|
13
|
-
fetchPolicy: 'cache-first',
|
|
14
|
-
variables: {
|
|
15
|
-
fromDate,
|
|
16
|
-
toDate
|
|
17
|
-
}
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
return {
|
|
21
|
-
data: data?.getAllSalesStoreStatistic || [],
|
|
22
|
-
error,
|
|
23
|
-
loading
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { useLazyQuery } from '@apollo/client'
|
|
2
|
-
import { GET_ONE_SALE } from './queries'
|
|
3
|
-
|
|
4
|
-
export const useGetSale = () => {
|
|
5
|
-
const [getOneSalesStore, { loading, data, called, error }] = useLazyQuery(GET_ONE_SALE)
|
|
6
|
-
return {
|
|
7
|
-
data: data?.getOneSalesStore,
|
|
8
|
-
loading,
|
|
9
|
-
error,
|
|
10
|
-
called,
|
|
11
|
-
getOneSalesStore
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { useApolloClient, useQuery } from '@apollo/client'
|
|
2
|
-
import { GET_ALL_COUNT_SALES } from './queries'
|
|
3
|
-
|
|
4
|
-
export const useTotalSales = () => {
|
|
5
|
-
const client = useApolloClient()
|
|
6
|
-
|
|
7
|
-
const { data, loading, error } = useQuery(GET_ALL_COUNT_SALES, {
|
|
8
|
-
fetchPolicy: 'cache-and-network',
|
|
9
|
-
notifyOnNetworkStatusChange: true,
|
|
10
|
-
nextFetchPolicy: 'cache-first',
|
|
11
|
-
refetchWritePolicy: 'merge'
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
// Guarda la respuesta en la caché manualmente (opcional)
|
|
15
|
-
if (data) {
|
|
16
|
-
client.writeQuery({ query: GET_ALL_COUNT_SALES, data })
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return [data?.getTodaySales || 0, {
|
|
20
|
-
loading,
|
|
21
|
-
error
|
|
22
|
-
}]
|
|
23
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export const days = [
|
|
2
|
-
{
|
|
3
|
-
day: 1,
|
|
4
|
-
name: 'L'
|
|
5
|
-
},
|
|
6
|
-
{
|
|
7
|
-
day: 2,
|
|
8
|
-
name: 'M'
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
day: 3,
|
|
12
|
-
name: 'MI'
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
day: 4,
|
|
16
|
-
name: 'J'
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
day: 5,
|
|
20
|
-
name: 'V'
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
day: 6,
|
|
24
|
-
name: 'S'
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
day: 0,
|
|
28
|
-
name: 'D'
|
|
29
|
-
}
|
|
30
|
-
]
|
|
31
|
-
|
|
32
|
-
export const arraysAreEqual = (arr1, arr2) => {
|
|
33
|
-
if (arr1.length !== arr2.length) return false;
|
|
34
|
-
for (let i = 0; i < arr1.length; i++) {
|
|
35
|
-
if (arr1[i] !== arr2[i]) return false;
|
|
36
|
-
}
|
|
37
|
-
return true;
|
|
38
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { useMutation } from '@apollo/client'
|
|
2
|
-
import { useState } from 'react'
|
|
3
|
-
import { days } from './helpers/index'
|
|
4
|
-
import { CREATE_AVAILABLE_PRODUCTS_DAYS } from './queries'
|
|
5
|
-
|
|
6
|
-
export const useSaveAvailableProduct = () => {
|
|
7
|
-
const [selectedDays, setSelectedDays] = useState([])
|
|
8
|
-
|
|
9
|
-
const handleDaySelection = (day) => {
|
|
10
|
-
if (selectedDays.includes(day)) {
|
|
11
|
-
setSelectedDays(selectedDays.filter((selectedDay) => { return selectedDay !== day }))
|
|
12
|
-
} else {
|
|
13
|
-
setSelectedDays([...selectedDays, day])
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
const handleCleanSelectedDays = () => {
|
|
17
|
-
setSelectedDays([])
|
|
18
|
-
}
|
|
19
|
-
const [registerAvailableProduct, { loading }] = useMutation(CREATE_AVAILABLE_PRODUCTS_DAYS, {
|
|
20
|
-
onError: () => { return console.log({ message: 'Lo sentimos ocurrió un error, vuelve a intentarlo' }) }
|
|
21
|
-
})
|
|
22
|
-
return {
|
|
23
|
-
handleDaySelection,
|
|
24
|
-
handleCleanSelectedDays,
|
|
25
|
-
selectedDays,
|
|
26
|
-
setSelectedDays,
|
|
27
|
-
days,
|
|
28
|
-
Loading: loading,
|
|
29
|
-
registerAvailableProduct
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useMutation } from '@apollo/client'
|
|
2
|
-
import { SAVE_LOCATION_USER } from './queries'
|
|
3
|
-
|
|
4
|
-
export const useSaveLocation = () => {
|
|
5
|
-
const [updateUserLocations, { loading, error, data }] =
|
|
6
|
-
useMutation(SAVE_LOCATION_USER)
|
|
7
|
-
|
|
8
|
-
return [
|
|
9
|
-
updateUserLocations,
|
|
10
|
-
{
|
|
11
|
-
loading,
|
|
12
|
-
error,
|
|
13
|
-
data
|
|
14
|
-
}
|
|
15
|
-
]
|
|
16
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { gql } from '@apollo/client'
|
|
2
|
-
|
|
3
|
-
export const SAVE_LOCATION_USER = gql`
|
|
4
|
-
mutation updateUserLocations($input: InputUserLocation) {
|
|
5
|
-
updateUserLocations(input: $input) {
|
|
6
|
-
locationId
|
|
7
|
-
id
|
|
8
|
-
cId
|
|
9
|
-
dId
|
|
10
|
-
ctId
|
|
11
|
-
uLatitud
|
|
12
|
-
uLongitude
|
|
13
|
-
uLocationKnow
|
|
14
|
-
uPiso
|
|
15
|
-
DatCre
|
|
16
|
-
DatMod
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
`
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { useQuery, useMutation } from '@apollo/client'
|
|
2
|
-
import {
|
|
3
|
-
GET_ONE_SCHEDULE_STORE,
|
|
4
|
-
GET_SCHEDULE_STORE,
|
|
5
|
-
CREATE_STORE_CALENDAR,
|
|
6
|
-
SET_STATUS_ALL_SCHEDULE_STORE
|
|
7
|
-
} from './queries'
|
|
8
|
-
|
|
9
|
-
export const useSchedule = ({ day = null, idStore = '' }) => {
|
|
10
|
-
const {
|
|
11
|
-
data,
|
|
12
|
-
loading,
|
|
13
|
-
error
|
|
14
|
-
} = useQuery(GET_ONE_SCHEDULE_STORE, { variables: { schDay: day, idStore } })
|
|
15
|
-
|
|
16
|
-
return [data?.getOneStoreSchedules, { loading, error }]
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const useSetScheduleOpenAll = () => {
|
|
20
|
-
const [setStoreSchedule, { loading, error }] = useMutation(SET_STATUS_ALL_SCHEDULE_STORE, {
|
|
21
|
-
onError: (e) => {
|
|
22
|
-
console.error(e)
|
|
23
|
-
}
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
const handleSetStoreSchedule = (scheduleOpenAll) => {
|
|
27
|
-
setStoreSchedule({
|
|
28
|
-
variables: {
|
|
29
|
-
scheduleOpenAll
|
|
30
|
-
},
|
|
31
|
-
update: (cache, { data }) => {
|
|
32
|
-
const success = data?.setScheduleOpenAll?.success
|
|
33
|
-
if (success) {
|
|
34
|
-
cache.modify({
|
|
35
|
-
fields: {
|
|
36
|
-
getStore (_, { readField }) {
|
|
37
|
-
const store = readField('getStore')
|
|
38
|
-
const updatedCart = {
|
|
39
|
-
...store,
|
|
40
|
-
scheduleOpenAll
|
|
41
|
-
}
|
|
42
|
-
return updatedCart
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
})
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
})
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return [handleSetStoreSchedule, { loading, error }]
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export const useSchedules = ({ schDay = 1, idStore = '', onCompleted = (data) => { return data } }) => {
|
|
55
|
-
const {
|
|
56
|
-
data,
|
|
57
|
-
loading,
|
|
58
|
-
error
|
|
59
|
-
} = useQuery(GET_SCHEDULE_STORE, {
|
|
60
|
-
variables: { schDay, idStore },
|
|
61
|
-
onCompleted: (data) => {
|
|
62
|
-
onCompleted(data)
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
)
|
|
66
|
-
|
|
67
|
-
return [data?.getStoreSchedules, { loading, error }]
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export const useCreateSchedules = () => {
|
|
71
|
-
const [setStoreSchedule, { loading, error }] = useMutation(CREATE_STORE_CALENDAR, {
|
|
72
|
-
onError: (e) => {
|
|
73
|
-
console.error(e)
|
|
74
|
-
}
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
return [setStoreSchedule, { loading, error }]
|
|
78
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { useQuery } from '@apollo/client'
|
|
2
|
-
import { GET_ONE_SCHEDULE_STORE, GET_SCHEDULE_STORE } from '../useProductsFood/queriesStore'
|
|
3
|
-
|
|
4
|
-
export const useSchedule = ({ day = null, idStore = '' }) => {
|
|
5
|
-
const {
|
|
6
|
-
data,
|
|
7
|
-
loading,
|
|
8
|
-
error
|
|
9
|
-
} = useQuery(GET_ONE_SCHEDULE_STORE, { variables: { schDay: day, idStore } })
|
|
10
|
-
|
|
11
|
-
return [data?.getOneStoreSchedules, { loading, error }]
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const useSchedules = ({ schDay = 1, idStore = '' }) => {
|
|
15
|
-
const {
|
|
16
|
-
data,
|
|
17
|
-
loading,
|
|
18
|
-
error
|
|
19
|
-
} = useQuery(GET_SCHEDULE_STORE, { variables: { schDay, idStore } })
|
|
20
|
-
|
|
21
|
-
return [data?.getStoreSchedules, { loading, error }]
|
|
22
|
-
}
|