npm-pkg-hook 1.3.6 → 1.3.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 (97) hide show
  1. package/.eslintrc.js +38 -38
  2. package/.eslintrc.json +127 -127
  3. package/.github/pull_request_template.md +17 -17
  4. package/.github/workflows/pepeline.yaml +29 -29
  5. package/package.json +46 -46
  6. package/script.txt +6 -6
  7. package/src/config/client/index.js +1 -1
  8. package/src/hooks/getCategoriesWithProduct/helpers/index.js +7 -7
  9. package/src/hooks/getCategoriesWithProduct/index.js +62 -62
  10. package/src/hooks/getSession/index.js +18 -18
  11. package/src/hooks/handleLogin/index.js +10 -0
  12. package/src/hooks/index.js +1 -0
  13. package/src/hooks/useAnimationFrame/index.js +45 -45
  14. package/src/hooks/useAsideCart/index.js +155 -155
  15. package/src/hooks/useAsideCart/queries.js +10 -10
  16. package/src/hooks/useCart/index.js +2 -2
  17. package/src/hooks/useCart/queries.js +164 -164
  18. package/src/hooks/useCart/useCart/helpers/index.js +75 -75
  19. package/src/hooks/useCart/useCart/index.js +410 -410
  20. package/src/hooks/useCart/useGetCart/index.js +31 -31
  21. package/src/hooks/useCatWithProductClient/index.js +56 -56
  22. package/src/hooks/useCatWithProductClient/queries.js +55 -55
  23. package/src/hooks/useCategoriesProduct/index.js +12 -12
  24. package/src/hooks/useCategoriesProduct/queries.js +16 -16
  25. package/src/hooks/useCategoryInStore/queries.js +78 -78
  26. package/src/hooks/useChartData/useChartData/index.js +199 -199
  27. package/src/hooks/useChartData/useChartDataAllOrders/index.js +94 -94
  28. package/src/hooks/useCheckbox/index.js +115 -115
  29. package/src/hooks/useCreateProduct/helpers/manageCacheDataCatProduct/index.js +52 -0
  30. package/src/hooks/useCreateProduct/index.js +8 -3
  31. package/src/hooks/useDeleteSubProductOptional/index.js +30 -30
  32. package/src/hooks/useDeleteSubProductOptional/queries.js +10 -10
  33. package/src/hooks/useDessert/helpers/index.js +51 -51
  34. package/src/hooks/useDevices/index.js +35 -35
  35. package/src/hooks/useDevices/queries.js +19 -19
  36. package/src/hooks/useDropzone/index.js +94 -94
  37. package/src/hooks/useDynamicAuth/index.js +13 -13
  38. package/src/hooks/useDynamicAuth/queries.js +24 -24
  39. package/src/hooks/useEditSubProductOptional/queries.js +10 -10
  40. package/src/hooks/useEvent/index.js +33 -33
  41. package/src/hooks/useFavoriteStores/index.js +19 -19
  42. package/src/hooks/useFavoriteStores/queries.js +47 -47
  43. package/src/hooks/useFetchJson/index.js +25 -25
  44. package/src/hooks/useFingerprintjs/index.js +172 -172
  45. package/src/hooks/useFullScreenMode/index.js +65 -65
  46. package/src/hooks/useGenerateNumberArray/index.js +17 -17
  47. package/src/hooks/useGetExtProductFoodsSubOptionalAll/index.js +14 -14
  48. package/src/hooks/useGetFoodRecomended/index.js +32 -33
  49. package/src/hooks/useGetFoodRecomended/queries.js +47 -47
  50. package/src/hooks/useGetMinPrice/index.js +12 -12
  51. package/src/hooks/useGetMinPrice/queries.js +7 -7
  52. package/src/hooks/useGetOneStoreRating/index.js +40 -40
  53. package/src/hooks/useGetOneStoreRating/queries.js +18 -18
  54. package/src/hooks/useGoogleLogin/index.js +160 -160
  55. package/src/hooks/useGoogleLogin/loadScript.js +15 -15
  56. package/src/hooks/useGoogleLogin/removeScript.js +7 -7
  57. package/src/hooks/useHover/index.js +29 -29
  58. package/src/hooks/useImagesStore/index.js +5 -4
  59. package/src/hooks/useInnerHtml/index.js +39 -39
  60. package/src/hooks/useKeypress/index.js +28 -28
  61. package/src/hooks/useLocationNavigate/index.js +54 -54
  62. package/src/hooks/useLogout/index.js +29 -21
  63. package/src/hooks/useManageQueryParams/index.js +37 -36
  64. package/src/hooks/useMobile/index.js +39 -39
  65. package/src/hooks/useOrderClient/index.js +5 -5
  66. package/src/hooks/useProviders/index.js +3 -3
  67. package/src/hooks/useProviders/queries.js +31 -31
  68. package/src/hooks/useProviders/useProvidersCreateStore/index.js +12 -12
  69. package/src/hooks/useProviders/useProvidersDataStore/index.js +24 -24
  70. package/src/hooks/useProvidersStore/index.js +24 -24
  71. package/src/hooks/useProvidersStore/queries.js +31 -31
  72. package/src/hooks/useRatingArrayData/index.js +54 -54
  73. package/src/hooks/useRatingArrayData/queries.js +19 -19
  74. package/src/hooks/useRemoveExtraProductFoodsOptional/index.js +23 -23
  75. package/src/hooks/useRemoveExtraProductFoodsOptional/queries.js +48 -48
  76. package/src/hooks/useRestaurant/index.js +19 -19
  77. package/src/hooks/useRestaurant/queries.js +80 -80
  78. package/src/hooks/useSales/useGetAllSales/index.js +25 -25
  79. package/src/hooks/useSchedule/index.js +72 -72
  80. package/src/hooks/useSchedule/index.jsx +22 -22
  81. package/src/hooks/useSchedule/queries.js +43 -43
  82. package/src/hooks/useScheduleData/index.js +123 -123
  83. package/src/hooks/useScroll/index.js +56 -56
  84. package/src/hooks/useScrollRotate/index.js +16 -16
  85. package/src/hooks/useStatusOpenStore/helpers/index.js +101 -101
  86. package/src/hooks/useStatusOpenStore/index.js +172 -172
  87. package/src/hooks/useStatusOrdersClient/queries.js +80 -80
  88. package/src/hooks/useStore/queries.js +163 -163
  89. package/src/hooks/useStoreCalendar/index.js +5 -5
  90. package/src/hooks/useStoreContacts/queries.js +1 -1
  91. package/src/hooks/useTimeAgo/useTimeAgo.js +39 -39
  92. package/src/hooks/useUpdateExtProductFoodsSubOptional/index.js +38 -38
  93. package/src/hooks/useWindowSize/index.js +38 -38
  94. package/src/mock/dessert/index.js +16 -16
  95. package/src/mock/index.js +1 -1
  96. package/.vscode/extensions.json +0 -6
  97. package/.vscode/settings.json +0 -8
@@ -1,24 +1,24 @@
1
- import { useQuery } from '@apollo/client'
2
- import { GET_ALL_PROVIDERS } from './queries'
3
-
4
- export const useProvidersStore = () => {
5
- const {
6
- data,
7
- fetchMore,
8
- loading,
9
- error,
10
- called
11
- } = useQuery(GET_ALL_PROVIDERS, {
12
- fetchPolicy: 'cache-and-network',
13
- notifyOnNetworkStatusChange: true,
14
- nextFetchPolicy: 'cache-first',
15
- refetchWritePolicy: 'merge'
16
- })
17
- const providerData = data?.getAllProviders || []
18
- return [providerData, {
19
- fetchMore,
20
- called,
21
- error,
22
- loading
23
- }]
24
- }
1
+ import { useQuery } from '@apollo/client'
2
+ import { GET_ALL_PROVIDERS } from './queries'
3
+
4
+ export const useProvidersStore = () => {
5
+ const {
6
+ data,
7
+ fetchMore,
8
+ loading,
9
+ error,
10
+ called
11
+ } = useQuery(GET_ALL_PROVIDERS, {
12
+ fetchPolicy: 'cache-and-network',
13
+ notifyOnNetworkStatusChange: true,
14
+ nextFetchPolicy: 'cache-first',
15
+ refetchWritePolicy: 'merge'
16
+ })
17
+ const providerData = data?.getAllProviders || []
18
+ return [providerData, {
19
+ fetchMore,
20
+ called,
21
+ error,
22
+ loading
23
+ }]
24
+ }
@@ -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,54 +1,54 @@
1
- import { useState, useEffect } from 'react'
2
- import { useQuery } from '@apollo/client'
3
- // eslint-disable-next-line camelcase
4
- import { GET_All_RATING_STORE } from './queries'
5
-
6
- export const useRatingArrayData = () => {
7
- const { data: dataRating } = useQuery(GET_All_RATING_STORE)
8
-
9
- const calculateTotalRatings = (ratings = []) => {
10
- return ratings.reduce(
11
- (total, rating) => ({
12
- rAppearance: total?.rAppearance + rating?.rAppearance,
13
- rTasty: total?.rTasty + rating?.rTasty,
14
- rGoodCondition: total?.rGoodCondition + rating?.rGoodCondition,
15
- rGoodTemperature: total?.rGoodTemperature + rating?.rGoodTemperature
16
- }),
17
- {
18
- rAppearance: 0,
19
- rTasty: 0,
20
- rGoodCondition: 0,
21
- rGoodTemperature: 0
22
- }
23
- )
24
- }
25
-
26
- const [totalRatings, setTotalRatings] = useState(
27
- calculateTotalRatings(dataRating?.getAllRating || [])
28
- )
29
-
30
- useEffect(() => {
31
- setTotalRatings(calculateTotalRatings(dataRating?.getAllRating || []))
32
- }, [dataRating])
33
-
34
- const dataArr = [
35
- {
36
- name: 'Buena apariencia',
37
- value: totalRatings.rAppearance || 0
38
- },
39
- {
40
- name: 'Es deliciosa',
41
- value: totalRatings.rTasty || 0
42
- },
43
- {
44
- name: 'Buenas condiciones',
45
- value: totalRatings.rGoodCondition || 0
46
- },
47
- {
48
- name: 'Buena temperatura',
49
- value: totalRatings.rGoodTemperature || 0
50
- }
51
- ]
52
-
53
- return dataArr
54
- }
1
+ import { useState, useEffect } from 'react'
2
+ import { useQuery } from '@apollo/client'
3
+ // eslint-disable-next-line camelcase
4
+ import { GET_All_RATING_STORE } from './queries'
5
+
6
+ export const useRatingArrayData = () => {
7
+ const { data: dataRating } = useQuery(GET_All_RATING_STORE)
8
+
9
+ const calculateTotalRatings = (ratings = []) => {
10
+ return ratings.reduce(
11
+ (total, rating) => ({
12
+ rAppearance: total?.rAppearance + rating?.rAppearance,
13
+ rTasty: total?.rTasty + rating?.rTasty,
14
+ rGoodCondition: total?.rGoodCondition + rating?.rGoodCondition,
15
+ rGoodTemperature: total?.rGoodTemperature + rating?.rGoodTemperature
16
+ }),
17
+ {
18
+ rAppearance: 0,
19
+ rTasty: 0,
20
+ rGoodCondition: 0,
21
+ rGoodTemperature: 0
22
+ }
23
+ )
24
+ }
25
+
26
+ const [totalRatings, setTotalRatings] = useState(
27
+ calculateTotalRatings(dataRating?.getAllRating || [])
28
+ )
29
+
30
+ useEffect(() => {
31
+ setTotalRatings(calculateTotalRatings(dataRating?.getAllRating || []))
32
+ }, [dataRating])
33
+
34
+ const dataArr = [
35
+ {
36
+ name: 'Buena apariencia',
37
+ value: totalRatings.rAppearance || 0
38
+ },
39
+ {
40
+ name: 'Es deliciosa',
41
+ value: totalRatings.rTasty || 0
42
+ },
43
+ {
44
+ name: 'Buenas condiciones',
45
+ value: totalRatings.rGoodCondition || 0
46
+ },
47
+ {
48
+ name: 'Buena temperatura',
49
+ value: totalRatings.rGoodTemperature || 0
50
+ }
51
+ ]
52
+
53
+ return dataArr
54
+ }
@@ -1,19 +1,19 @@
1
- import { gql } from '@apollo/client'
2
-
3
- // eslint-disable-next-line camelcase
4
- export const GET_All_RATING_STORE = gql`
5
- query getAllRating($idStore: ID){
6
- getAllRating(idStore: $idStore){
7
- idStore
8
- rId
9
- id
10
- rAppearance
11
- rTasty
12
- rGoodTemperature
13
- rGoodCondition
14
- rState
15
- createAt
16
- updateAt
17
- }
18
- }
19
- `
1
+ import { gql } from '@apollo/client'
2
+
3
+ // eslint-disable-next-line camelcase
4
+ export const GET_All_RATING_STORE = gql`
5
+ query getAllRating($idStore: ID){
6
+ getAllRating(idStore: $idStore){
7
+ idStore
8
+ rId
9
+ id
10
+ rAppearance
11
+ rTasty
12
+ rGoodTemperature
13
+ rGoodCondition
14
+ rState
15
+ createAt
16
+ updateAt
17
+ }
18
+ }
19
+ `
@@ -1,23 +1,23 @@
1
- import { useMutation } from '@apollo/client'
2
- import { DELETE_CAT_EXTRA_PRODUCTS } from './queries'
3
-
4
- export const useRemoveExtraProductFoodsOptional = () => {
5
- const [DeleteExtProductFoodsOptional, { loading, error }] = useMutation(DELETE_CAT_EXTRA_PRODUCTS)
6
-
7
- const handleDeleteOptional = async elem => {
8
- const { state, opExPid } = elem || {}
9
- DeleteExtProductFoodsOptional({
10
- variables: {
11
- state,
12
- opExPid,
13
- isCustomOpExPid: true
14
- }
15
- })
16
- }
17
- return {
18
- handleDeleteOptional,
19
- DeleteExtProductFoodsOptional,
20
- loading,
21
- error
22
- }
23
- }
1
+ import { useMutation } from '@apollo/client'
2
+ import { DELETE_CAT_EXTRA_PRODUCTS } from './queries'
3
+
4
+ export const useRemoveExtraProductFoodsOptional = () => {
5
+ const [DeleteExtProductFoodsOptional, { loading, error }] = useMutation(DELETE_CAT_EXTRA_PRODUCTS)
6
+
7
+ const handleDeleteOptional = async elem => {
8
+ const { state, opExPid } = elem || {}
9
+ DeleteExtProductFoodsOptional({
10
+ variables: {
11
+ state,
12
+ opExPid,
13
+ isCustomOpExPid: true
14
+ }
15
+ })
16
+ }
17
+ return {
18
+ handleDeleteOptional,
19
+ DeleteExtProductFoodsOptional,
20
+ loading,
21
+ error
22
+ }
23
+ }
@@ -1,48 +1,48 @@
1
- import { gql } from '@apollo/client'
2
-
3
- export const DELETE_CAT_EXTRA_PRODUCTS = gql`
4
- mutation DeleteExtProductFoodsOptional($opExPid: ID, $state: Int, $isCustomOpExPid: Boolean) {
5
- DeleteExtProductFoodsOptional(opExPid: $opExPid, state: $state, isCustomOpExPid: $isCustomOpExPid) {
6
- success
7
- message
8
- }
9
- }
10
- `
11
-
12
- export const GET_EXTRAS_PRODUCT_FOOD_OPTIONAL = gql`
13
- query ExtProductFoodsOptionalAll(
14
- $search: String
15
- $min: Int
16
- $max: Int
17
- $pId: ID
18
- ) {
19
- ExtProductFoodsOptionalAll(
20
- search: $search
21
- min: $min
22
- max: $max
23
- pId: $pId
24
- ) {
25
- pId
26
- opExPid
27
- OptionalProName
28
- state
29
- code
30
- numbersOptionalOnly
31
- pDatCre
32
- required
33
- pDatMod
34
- ExtProductFoodsSubOptionalAll {
35
- pId
36
- opExPid
37
- idStore
38
- opSubExPid
39
- OptionalSubProName
40
- exCodeOptionExtra
41
- exCode
42
- state
43
- pDatCre
44
- pDatMod
45
- }
46
- }
47
- }
48
- `
1
+ import { gql } from '@apollo/client'
2
+
3
+ export const DELETE_CAT_EXTRA_PRODUCTS = gql`
4
+ mutation DeleteExtProductFoodsOptional($opExPid: ID, $state: Int, $isCustomOpExPid: Boolean) {
5
+ DeleteExtProductFoodsOptional(opExPid: $opExPid, state: $state, isCustomOpExPid: $isCustomOpExPid) {
6
+ success
7
+ message
8
+ }
9
+ }
10
+ `
11
+
12
+ export const GET_EXTRAS_PRODUCT_FOOD_OPTIONAL = gql`
13
+ query ExtProductFoodsOptionalAll(
14
+ $search: String
15
+ $min: Int
16
+ $max: Int
17
+ $pId: ID
18
+ ) {
19
+ ExtProductFoodsOptionalAll(
20
+ search: $search
21
+ min: $min
22
+ max: $max
23
+ pId: $pId
24
+ ) {
25
+ pId
26
+ opExPid
27
+ OptionalProName
28
+ state
29
+ code
30
+ numbersOptionalOnly
31
+ pDatCre
32
+ required
33
+ pDatMod
34
+ ExtProductFoodsSubOptionalAll {
35
+ pId
36
+ opExPid
37
+ idStore
38
+ opSubExPid
39
+ OptionalSubProName
40
+ exCodeOptionExtra
41
+ exCode
42
+ state
43
+ pDatCre
44
+ pDatMod
45
+ }
46
+ }
47
+ }
48
+ `
@@ -1,19 +1,19 @@
1
- import { useQuery } from '@apollo/client'
2
- import { GET_ALL_RESTAURANT } from './queries'
3
-
4
- export const useRestaurant = () => {
5
- const {
6
- data,
7
- loading,
8
- error,
9
- fetchMore
10
- } = useQuery(GET_ALL_RESTAURANT, {
11
- fetchPolicy: 'cache-and-network',
12
- notifyOnNetworkStatusChange: true,
13
- nextFetchPolicy: 'cache-first',
14
- refetchWritePolicy: 'merge',
15
- context: { clientName: 'admin-store' }
16
- })
17
- const dataRestaurant = data?.getAllStoreInStore
18
- return [dataRestaurant, { loading, error, fetchMore }]
19
- }
1
+ import { useQuery } from '@apollo/client'
2
+ import { GET_ALL_RESTAURANT } from './queries'
3
+
4
+ export const useRestaurant = () => {
5
+ const {
6
+ data,
7
+ loading,
8
+ error,
9
+ fetchMore
10
+ } = useQuery(GET_ALL_RESTAURANT, {
11
+ fetchPolicy: 'cache-and-network',
12
+ notifyOnNetworkStatusChange: true,
13
+ nextFetchPolicy: 'cache-first',
14
+ refetchWritePolicy: 'merge',
15
+ context: { clientName: 'admin-store' }
16
+ })
17
+ const dataRestaurant = data?.getAllStoreInStore
18
+ return [dataRestaurant, { loading, error, fetchMore }]
19
+ }
@@ -1,80 +1,80 @@
1
- import { gql } from '@apollo/client'
2
- export const GET_ALL_RESTAURANT = gql`
3
- query getAllStoreInStore($search: String, $min: Int, $max: Int){
4
- getAllStoreInStore(search: $search, min: $min, max: $max) {
5
- open
6
- getStoreSchedules {
7
- idStore
8
- schId
9
- schDay
10
- schHoSta
11
- schHoEnd
12
- schState
13
- }
14
- idStore
15
- cId
16
- id
17
- dId
18
- ctId
19
- catStore
20
- neighborhoodStore
21
- Viaprincipal
22
- storeOwner
23
- storeName
24
- cateStore{
25
- catStore
26
- cName
27
- }
28
- emailStore
29
- storePhone
30
- socialRaz
31
- Image
32
- banner
33
- documentIdentifier
34
- uPhoNum
35
- ULocation
36
- upLat
37
- upLon
38
- uState
39
- siteWeb
40
- description
41
- NitStore
42
- typeRegiments
43
- typeContribute
44
- secVia
45
- addressStore
46
- createdAt
47
- pais{
48
- cId
49
- cName
50
- cCalCod
51
- cState
52
- cDatCre
53
- cDatMod
54
- }
55
- city {
56
- ctId
57
- dId
58
- cName
59
- cState
60
- cDatCre
61
- cDatMod
62
- }
63
- department {
64
- dId
65
- cId
66
- dName
67
- dState
68
- dDatCre
69
- dDatMod
70
- }
71
- getAllRatingStar {
72
- rSId
73
- rScore
74
- idStore
75
- createAt
76
- }
77
- }
78
-
79
- }
80
- `
1
+ import { gql } from '@apollo/client'
2
+ export const GET_ALL_RESTAURANT = gql`
3
+ query getAllStoreInStore($search: String, $min: Int, $max: Int){
4
+ getAllStoreInStore(search: $search, min: $min, max: $max) {
5
+ open
6
+ getStoreSchedules {
7
+ idStore
8
+ schId
9
+ schDay
10
+ schHoSta
11
+ schHoEnd
12
+ schState
13
+ }
14
+ idStore
15
+ cId
16
+ id
17
+ dId
18
+ ctId
19
+ catStore
20
+ neighborhoodStore
21
+ Viaprincipal
22
+ storeOwner
23
+ storeName
24
+ cateStore{
25
+ catStore
26
+ cName
27
+ }
28
+ emailStore
29
+ storePhone
30
+ socialRaz
31
+ Image
32
+ banner
33
+ documentIdentifier
34
+ uPhoNum
35
+ ULocation
36
+ upLat
37
+ upLon
38
+ uState
39
+ siteWeb
40
+ description
41
+ NitStore
42
+ typeRegiments
43
+ typeContribute
44
+ secVia
45
+ addressStore
46
+ createdAt
47
+ pais{
48
+ cId
49
+ cName
50
+ cCalCod
51
+ cState
52
+ cDatCre
53
+ cDatMod
54
+ }
55
+ city {
56
+ ctId
57
+ dId
58
+ cName
59
+ cState
60
+ cDatCre
61
+ cDatMod
62
+ }
63
+ department {
64
+ dId
65
+ cId
66
+ dName
67
+ dState
68
+ dDatCre
69
+ dDatMod
70
+ }
71
+ getAllRatingStar {
72
+ rSId
73
+ rScore
74
+ idStore
75
+ createAt
76
+ }
77
+ }
78
+
79
+ }
80
+ `
@@ -1,25 +1,25 @@
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
+ 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
+ }