npm-pkg-hook 1.8.2 → 1.8.3

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/package.json CHANGED
@@ -44,5 +44,5 @@
44
44
  "rm": "rm -rf node_modules package-lock.json && npm i",
45
45
  "test": "echo \"Error: no test specified\" && exit 1"
46
46
  },
47
- "version": "1.8.2"
47
+ "version": "1.8.3"
48
48
  }
@@ -6,6 +6,7 @@ export * from './useCategoryStore'
6
6
  export * from './useCatWithProduct'
7
7
  export * from './useManageQueryParams'
8
8
  export * from './useDeliveryTime'
9
+ export * from './useModules'
9
10
  export * from './getTotalHours'
10
11
  export * from './useTokenCards'
11
12
  export * from './useSubscriptionValidation'
@@ -0,0 +1,29 @@
1
+ import { gql, useQuery } from '@apollo/client'
2
+
3
+ const GET_MODULES = gql`
4
+ query GetModules {
5
+ modules {
6
+ mName
7
+ mId
8
+ mPath
9
+ mPriority
10
+ mIcon
11
+ subModules {
12
+ smId
13
+ smName
14
+ smPath
15
+ smState
16
+ }
17
+ }
18
+ }
19
+ `
20
+
21
+ export const useModules = () => {
22
+ const { loading, error, data } = useQuery(GET_MODULES)
23
+
24
+ return {
25
+ loading,
26
+ error,
27
+ modules: data ? data.modules : []
28
+ }
29
+ }
@@ -32,8 +32,7 @@ export const useReport = ({
32
32
  toDate
33
33
  }
34
34
  })
35
- console.log(fromDate,
36
- toDate)
35
+
37
36
  const totalSales = totalSalesData?.getAllSalesStoreTotal ?? {}
38
37
 
39
38
  return {