@greatapps/common 1.1.564 → 1.1.565

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.
@@ -2,10 +2,7 @@
2
2
  import { useQuery } from "@tanstack/react-query";
3
3
  import { withAction } from "../../../utils/withAction";
4
4
  import { useAuthQueryKey } from "../../../hooks/useAuthQueryKey";
5
- import { useAuth } from "../../../providers/auth.provider";
6
5
  function useCardById(id) {
7
- const { account } = useAuth();
8
- const isVindi = account?.gateway === "vindi";
9
6
  const cardKey = useAuthQueryKey(["card", id]);
10
7
  return useQuery({
11
8
  queryKey: cardKey,
@@ -13,7 +10,7 @@ function useCardById(id) {
13
10
  const { findCardByIdAction } = await import("../actions/find-card-by-id.action");
14
11
  return withAction(findCardByIdAction)(id);
15
12
  },
16
- enabled: id != null && !isVindi
13
+ enabled: id != null
17
14
  });
18
15
  }
19
16
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/modules/cards/hooks/card-by-id.hook.ts"],"sourcesContent":["'use client';\n\nimport { useQuery } from '@tanstack/react-query';\nimport { withAction } from '../../../utils/withAction';\nimport { useAuthQueryKey } from '../../../hooks/useAuthQueryKey';\nimport { useAuth } from '../../../providers/auth.provider';\n\nexport function useCardById(id: number | undefined) {\n const { account } = useAuth();\n const isVindi = account?.gateway === 'vindi';\n const cardKey = useAuthQueryKey(['card', id]);\n\n return useQuery({\n queryKey: cardKey,\n queryFn: async () => {\n const { findCardByIdAction } = await import('../actions/find-card-by-id.action');\n return withAction(findCardByIdAction)(id!);\n },\n enabled: id != null && !isVindi,\n });\n}\n"],"mappings":";AAEA,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAC3B,SAAS,uBAAuB;AAChC,SAAS,eAAe;AAEjB,SAAS,YAAY,IAAwB;AAClD,QAAM,EAAE,QAAQ,IAAI,QAAQ;AAC5B,QAAM,UAAU,SAAS,YAAY;AACrC,QAAM,UAAU,gBAAgB,CAAC,QAAQ,EAAE,CAAC;AAE5C,SAAO,SAAS;AAAA,IACd,UAAU;AAAA,IACV,SAAS,YAAY;AACnB,YAAM,EAAE,mBAAmB,IAAI,MAAM,OAAO,mCAAmC;AAC/E,aAAO,WAAW,kBAAkB,EAAE,EAAG;AAAA,IAC3C;AAAA,IACA,SAAS,MAAM,QAAQ,CAAC;AAAA,EAC1B,CAAC;AACH;","names":[]}
1
+ {"version":3,"sources":["../../../../src/modules/cards/hooks/card-by-id.hook.ts"],"sourcesContent":["'use client';\n\nimport { useQuery } from '@tanstack/react-query';\nimport { withAction } from '../../../utils/withAction';\nimport { useAuthQueryKey } from '../../../hooks/useAuthQueryKey';\n\nexport function useCardById(id: number | undefined) {\n const cardKey = useAuthQueryKey(['card', id]);\n\n return useQuery({\n queryKey: cardKey,\n queryFn: async () => {\n const { findCardByIdAction } = await import('../actions/find-card-by-id.action');\n return withAction(findCardByIdAction)(id!);\n },\n enabled: id != null,\n });\n}\n"],"mappings":";AAEA,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAC3B,SAAS,uBAAuB;AAEzB,SAAS,YAAY,IAAwB;AAClD,QAAM,UAAU,gBAAgB,CAAC,QAAQ,EAAE,CAAC;AAE5C,SAAO,SAAS;AAAA,IACd,UAAU;AAAA,IACV,SAAS,YAAY;AACnB,YAAM,EAAE,mBAAmB,IAAI,MAAM,OAAO,mCAAmC;AAC/E,aAAO,WAAW,kBAAkB,EAAE,EAAG;AAAA,IAC3C;AAAA,IACA,SAAS,MAAM;AAAA,EACjB,CAAC;AACH;","names":[]}
@@ -2,19 +2,15 @@
2
2
  import { useQuery } from "@tanstack/react-query";
3
3
  import { withAction } from "../../../utils/withAction";
4
4
  import { useAuthQueryKey } from "../../../hooks/useAuthQueryKey";
5
- import { useAuth } from "../../../providers/auth.provider";
6
5
  const CARDS_QUERY_KEY = ["cards"];
7
6
  function useCards() {
8
- const { account } = useAuth();
9
- const isVindi = account?.gateway === "vindi";
10
7
  const queryKey = useAuthQueryKey([...CARDS_QUERY_KEY]);
11
8
  return useQuery({
12
9
  queryKey,
13
10
  queryFn: async () => {
14
11
  const { listCardsAction } = await import("../actions/list-cards.action");
15
12
  return withAction(listCardsAction)();
16
- },
17
- enabled: !isVindi
13
+ }
18
14
  });
19
15
  }
20
16
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/modules/cards/hooks/cards.hook.ts"],"sourcesContent":["'use client';\n\nimport { useQuery } from '@tanstack/react-query';\nimport { withAction } from '../../../utils/withAction';\nimport { useAuthQueryKey } from '../../../hooks/useAuthQueryKey';\nimport { useAuth } from '../../../providers/auth.provider';\n\nexport const CARDS_QUERY_KEY = ['cards'] as const;\n\nexport function useCards() {\n const { account } = useAuth();\n const isVindi = account?.gateway === 'vindi';\n const queryKey = useAuthQueryKey([...CARDS_QUERY_KEY]);\n\n return useQuery({\n queryKey,\n queryFn: async () => {\n const { listCardsAction } = await import('../actions/list-cards.action');\n return withAction(listCardsAction)();\n },\n enabled: !isVindi,\n });\n}\n"],"mappings":";AAEA,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAC3B,SAAS,uBAAuB;AAChC,SAAS,eAAe;AAEjB,MAAM,kBAAkB,CAAC,OAAO;AAEhC,SAAS,WAAW;AACzB,QAAM,EAAE,QAAQ,IAAI,QAAQ;AAC5B,QAAM,UAAU,SAAS,YAAY;AACrC,QAAM,WAAW,gBAAgB,CAAC,GAAG,eAAe,CAAC;AAErD,SAAO,SAAS;AAAA,IACd;AAAA,IACA,SAAS,YAAY;AACnB,YAAM,EAAE,gBAAgB,IAAI,MAAM,OAAO,8BAA8B;AACvE,aAAO,WAAW,eAAe,EAAE;AAAA,IACrC;AAAA,IACA,SAAS,CAAC;AAAA,EACZ,CAAC;AACH;","names":[]}
1
+ {"version":3,"sources":["../../../../src/modules/cards/hooks/cards.hook.ts"],"sourcesContent":["'use client';\n\nimport { useQuery } from '@tanstack/react-query';\nimport { withAction } from '../../../utils/withAction';\nimport { useAuthQueryKey } from '../../../hooks/useAuthQueryKey';\n\nexport const CARDS_QUERY_KEY = ['cards'] as const;\n\nexport function useCards() {\n const queryKey = useAuthQueryKey([...CARDS_QUERY_KEY]);\n\n return useQuery({\n queryKey,\n queryFn: async () => {\n const { listCardsAction } = await import('../actions/list-cards.action');\n return withAction(listCardsAction)();\n },\n });\n}\n"],"mappings":";AAEA,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAC3B,SAAS,uBAAuB;AAEzB,MAAM,kBAAkB,CAAC,OAAO;AAEhC,SAAS,WAAW;AACzB,QAAM,WAAW,gBAAgB,CAAC,GAAG,eAAe,CAAC;AAErD,SAAO,SAAS;AAAA,IACd;AAAA,IACA,SAAS,YAAY;AACnB,YAAM,EAAE,gBAAgB,IAAI,MAAM,OAAO,8BAA8B;AACvE,aAAO,WAAW,eAAe,EAAE;AAAA,IACrC;AAAA,EACF,CAAC;AACH;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greatapps/common",
3
- "version": "1.1.564",
3
+ "version": "1.1.565",
4
4
  "description": "Shared library for GreatApps frontend applications",
5
5
  "main": "./dist/index.mjs",
6
6
  "types": "./src/index.ts",
@@ -3,11 +3,8 @@
3
3
  import { useQuery } from '@tanstack/react-query';
4
4
  import { withAction } from '../../../utils/withAction';
5
5
  import { useAuthQueryKey } from '../../../hooks/useAuthQueryKey';
6
- import { useAuth } from '../../../providers/auth.provider';
7
6
 
8
7
  export function useCardById(id: number | undefined) {
9
- const { account } = useAuth();
10
- const isVindi = account?.gateway === 'vindi';
11
8
  const cardKey = useAuthQueryKey(['card', id]);
12
9
 
13
10
  return useQuery({
@@ -16,6 +13,6 @@ export function useCardById(id: number | undefined) {
16
13
  const { findCardByIdAction } = await import('../actions/find-card-by-id.action');
17
14
  return withAction(findCardByIdAction)(id!);
18
15
  },
19
- enabled: id != null && !isVindi,
16
+ enabled: id != null,
20
17
  });
21
18
  }
@@ -3,13 +3,10 @@
3
3
  import { useQuery } from '@tanstack/react-query';
4
4
  import { withAction } from '../../../utils/withAction';
5
5
  import { useAuthQueryKey } from '../../../hooks/useAuthQueryKey';
6
- import { useAuth } from '../../../providers/auth.provider';
7
6
 
8
7
  export const CARDS_QUERY_KEY = ['cards'] as const;
9
8
 
10
9
  export function useCards() {
11
- const { account } = useAuth();
12
- const isVindi = account?.gateway === 'vindi';
13
10
  const queryKey = useAuthQueryKey([...CARDS_QUERY_KEY]);
14
11
 
15
12
  return useQuery({
@@ -18,6 +15,5 @@ export function useCards() {
18
15
  const { listCardsAction } = await import('../actions/list-cards.action');
19
16
  return withAction(listCardsAction)();
20
17
  },
21
- enabled: !isVindi,
22
18
  });
23
19
  }