@opexa/portal-components 0.0.106 → 0.0.108
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/client/hooks/useAuthenticateMutation.js +2 -1
- package/dist/client/hooks/useCheckInDailyCheckInQuestMutation.d.ts +1 -1
- package/dist/client/hooks/useCheckInDailyCheckInQuestMutation.js +20 -2
- package/dist/client/hooks/useClaimCashbackBonusMutation.js +2 -1
- package/dist/client/hooks/useClaimSpotBonusMutation.js +2 -1
- package/dist/client/hooks/useCompleteOnboardingMutation.d.ts +3 -0
- package/dist/client/hooks/useCompleteOnboardingMutation.js +25 -0
- package/dist/client/hooks/useCreateGCashDepositMutation.js +2 -1
- package/dist/client/hooks/useCreateGCashWithdrawalMutation.js +1 -1
- package/dist/client/hooks/useCreateGameSessionMutation.js +1 -1
- package/dist/client/hooks/useCreateInstapayWithdrawalMutation.js +1 -1
- package/dist/client/hooks/useCreateMayaAppDepositMutation.js +2 -1
- package/dist/client/hooks/useCreateMayaAppWithdrawalMutation.js +1 -1
- package/dist/client/hooks/useCreateMayaDepositMutation.js +2 -1
- package/dist/client/hooks/useCreateMayaWithdrawalMutation.js +1 -1
- package/dist/client/hooks/useCreateMemberVerificationMutation.d.ts +4 -0
- package/dist/client/hooks/useCreateMemberVerificationMutation.js +45 -0
- package/dist/client/hooks/useCreateOnlineBankDepositMutation.js +2 -1
- package/dist/client/hooks/useCreateQRPHDepositMutation.js +2 -1
- package/dist/client/hooks/useEndGameSessionMutation.js +1 -1
- package/dist/client/hooks/useFileQuery.d.ts +2 -0
- package/dist/client/hooks/useFileQuery.js +30 -0
- package/dist/client/hooks/useMarkGameAsFavoriteMutation.js +24 -5
- package/dist/client/hooks/useMarkMessageAsReadMutation.js +16 -7
- package/dist/client/hooks/useOnboardingStatusQuery.d.ts +2 -0
- package/dist/client/hooks/useOnboardingStatusQuery.js +28 -0
- package/dist/client/hooks/useRecommendedGamesQuery.d.ts +2 -0
- package/dist/client/hooks/useRecommendedGamesQuery.js +27 -0
- package/dist/client/hooks/useSendVerificationCodeMutation.js +1 -1
- package/dist/client/hooks/useSignInMutation.js +2 -1
- package/dist/client/hooks/useSignOutMutation.js +2 -1
- package/dist/client/hooks/useSignUpMutation.js +1 -1
- package/dist/client/hooks/useSiteQuery.d.ts +2 -0
- package/dist/client/hooks/useSiteQuery.js +16 -0
- package/dist/client/hooks/useSkipOnboardingMutation.d.ts +2 -0
- package/dist/client/hooks/useSkipOnboardingMutation.js +25 -0
- package/dist/client/hooks/useUnmarkGameAsFavoriteMutation.js +5 -5
- package/dist/client/hooks/useUpdateAccountMutation.js +2 -1
- package/dist/client/hooks/useUpdateMemberVerificationMutation.d.ts +6 -0
- package/dist/client/hooks/useUpdateMemberVerificationMutation.js +38 -0
- package/dist/client/hooks/useUploadImageFileMutation.d.ts +4 -0
- package/dist/client/hooks/useUploadImageFileMutation.js +24 -0
- package/dist/client/utils/createContext.js +1 -1
- package/dist/client/utils/createRecipeContext.js +1 -1
- package/dist/components/BetRecords/BetRecords.client.js +1 -1
- package/dist/components/Bonuses/Bonuses.client.js +1 -1
- package/dist/components/Disclaimer/DisclaimerV1.js +1 -1
- package/dist/components/Games/Game.js +1 -1
- package/dist/components/Games/GamesCarousel.client.js +1 -1
- package/dist/components/Games/GamesList.client.js +1 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsList.d.ts +1 -0
- package/dist/components/Jackpots/JackpotsList/JackpotsList.js +1 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.d.ts +2 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.js +3 -3
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemMobile.d.ts +2 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemMobile.js +2 -2
- package/dist/components/KYC/BasicInformation.js +85 -4
- package/dist/components/KYC/CaptureIdDocument.d.ts +1 -0
- package/dist/components/KYC/CaptureIdDocument.js +11 -0
- package/dist/components/KYC/CaptureSelfie.d.ts +1 -0
- package/dist/components/KYC/CaptureSelfie.js +11 -0
- package/dist/components/KYC/IdentityVerification.js +20 -4
- package/dist/components/KYC/Indicator.js +1 -1
- package/dist/components/KYC/KYC.lazy.js +7 -1
- package/dist/components/KYC/PersonalInformation.js +92 -5
- package/dist/components/KYC/useKYC.d.ts +15 -0
- package/dist/components/KYC/useKYC.js +18 -1
- package/dist/components/Messages/Messages.lazy.js +1 -1
- package/dist/components/News/News.d.ts +10 -0
- package/dist/components/News/News.js +10 -0
- package/dist/components/News/index.d.ts +1 -0
- package/dist/components/News/index.js +1 -0
- package/dist/components/NewsFeed/NewsFeed.d.ts +18 -0
- package/dist/components/NewsFeed/NewsFeed.js +11 -0
- package/dist/components/NewsFeed/index.d.ts +1 -0
- package/dist/components/NewsFeed/index.js +1 -0
- package/dist/components/Promos/PromosCarousel.js +1 -1
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.d.ts +1 -4
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +28 -25
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestRules.d.ts +6 -0
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestRules.js +15 -0
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.d.ts +1 -4
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.js +27 -3
- package/dist/components/Quests/OnboardingQuest/OnboardingQuestRules.d.ts +6 -0
- package/dist/components/Quests/OnboardingQuest/OnboardingQuestRules.js +15 -0
- package/dist/components/Quests/Quests.client.js +22 -7
- package/dist/components/Quests/QuestsContext.d.ts +2 -0
- package/dist/components/Quests/QuestsContext.js +2 -0
- package/dist/components/Quests/WageringQuest/WageringQuest.d.ts +1 -4
- package/dist/components/Quests/WageringQuest/WageringQuest.js +12 -9
- package/dist/components/Quests/WageringQuest/WageringQuestRules.d.ts +7 -0
- package/dist/components/Quests/WageringQuest/WageringQuestRules.js +17 -0
- package/dist/components/Search/Search.lazy.d.ts +8 -0
- package/dist/components/Search/Search.lazy.js +8 -3
- package/dist/components/SignIn/MobileNumberSignIn.js +7 -4
- package/dist/components/SignIn/NameAndPasswordSignIn.js +10 -5
- package/dist/components/SignUp/SignUpForm.js +13 -7
- package/dist/components/TransactionRecords/DepositRecordsTable.js +1 -1
- package/dist/components/TransactionRecords/TransactionRecordsTable.js +1 -1
- package/dist/components/TransactionRecords/WithdrawalRecordsTable.js +1 -1
- package/dist/constants/{endpoints.js → Endpoint.js} +1 -1
- package/dist/constants/index.d.ts +7 -7
- package/dist/constants/index.js +7 -7
- package/dist/server/utils/prefetchAccountQuery.js +5 -2
- package/dist/server/utils/prefetchAvailablePromosQuery.js +5 -2
- package/dist/server/utils/prefetchAvailableQuestsCountQuery.js +5 -2
- package/dist/server/utils/prefetchAvailableQuestsQuery.js +5 -2
- package/dist/server/utils/prefetchBetRecordsQuery.js +5 -2
- package/dist/server/utils/prefetchBonusQuery.js +5 -2
- package/dist/server/utils/prefetchBonusesCountQuery.js +5 -2
- package/dist/server/utils/prefetchBonusesQuery.js +5 -2
- package/dist/server/utils/prefetchCashbackBonusQuery.js +5 -2
- package/dist/server/utils/prefetchCashbackBonusesCountQuery.js +5 -2
- package/dist/server/utils/prefetchCashbackBonusesQuery.js +5 -2
- package/dist/server/utils/prefetchCashbackQuery.js +5 -2
- package/dist/server/utils/prefetchCashbacksQuery.js +5 -2
- package/dist/server/utils/prefetchDepositQuery.js +5 -2
- package/dist/server/utils/prefetchDepositRecordsQuery.js +5 -2
- package/dist/server/utils/prefetchDepositsCountQuery.js +5 -2
- package/dist/server/utils/prefetchFavoriteGamesQuery.js +5 -2
- package/dist/server/utils/prefetchFileQuery.d.ts +1 -0
- package/dist/server/utils/prefetchFileQuery.js +23 -0
- package/dist/server/utils/prefetchGamesQuery.js +5 -2
- package/dist/server/utils/prefetchInstapayBankListQuery.js +5 -2
- package/dist/server/utils/prefetchIsMayaSessionValidQuery.js +5 -2
- package/dist/server/utils/prefetchJackpotsCountQuery.js +5 -2
- package/dist/server/utils/prefetchJackpotsQuery.js +5 -2
- package/dist/server/utils/prefetchMemberVerificationQuery.js +5 -2
- package/dist/server/utils/prefetchOnboardingStatusQuery.d.ts +1 -0
- package/dist/server/utils/prefetchOnboardingStatusQuery.js +24 -0
- package/dist/server/utils/prefetchPaymentSettingsQuery.js +5 -2
- package/dist/server/utils/prefetchPlatformQuery.js +5 -2
- package/dist/server/utils/prefetchProfileCompletionQuery.js +5 -2
- package/dist/server/utils/prefetchPromoQuery.js +5 -2
- package/dist/server/utils/prefetchPromosQuery.js +5 -2
- package/dist/server/utils/prefetchRecommendedGamesQuery.d.ts +1 -0
- package/dist/server/utils/prefetchRecommendedGamesQuery.js +23 -0
- package/dist/server/utils/prefetchSessionQuery.js +6 -3
- package/dist/server/utils/prefetchSiteQuery.d.ts +1 -0
- package/dist/server/utils/prefetchSiteQuery.js +17 -0
- package/dist/server/utils/prefetchTopWinsQuery.js +5 -2
- package/dist/server/utils/prefetchTournamentsCountQuery.js +5 -2
- package/dist/server/utils/prefetchTournamentsQuery.js +5 -2
- package/dist/server/utils/prefetchTransactionRecordsQuery.js +5 -2
- package/dist/server/utils/prefetchUnreadMessagesCountQuery.js +5 -2
- package/dist/server/utils/prefetchWalletQuery.js +5 -2
- package/dist/server/utils/prefetchWithdrawalRecordsQuery.js +5 -2
- package/dist/services/account.d.ts +1 -0
- package/dist/services/account.js +11 -1
- package/dist/services/queries.d.ts +2 -1
- package/dist/services/queries.js +19 -1
- package/dist/styles/theme.css +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Checkbox/checkbox.recipe.js +2 -2
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/Dialog/dialog.recipe.js +1 -1
- package/dist/ui/Menu/Menu.d.ts +144 -144
- package/dist/ui/Menu/menu.recipe.d.ts +8 -8
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Table/Table.d.ts +21 -21
- package/dist/ui/Table/table.anatomy.d.ts +1 -1
- package/dist/ui/Table/table.recipe.d.ts +3 -3
- package/dist/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/dist/utils/callIfFn.d.ts +8 -0
- package/dist/utils/callIfFn.js +8 -0
- package/dist/utils/createPoll.d.ts +1 -0
- package/dist/utils/createPoll.js +1 -0
- package/dist/utils/createSplitProps.d.ts +9 -0
- package/dist/utils/createSplitProps.js +9 -0
- package/dist/utils/log.d.ts +3 -0
- package/dist/utils/log.js +18 -0
- package/dist/utils/mutationKeys.d.ts +29 -0
- package/dist/utils/mutationKeys.js +104 -0
- package/dist/utils/queryKeys.d.ts +5 -24
- package/dist/utils/queryKeys.js +80 -97
- package/package.json +1 -1
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.d.ts +0 -8
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +0 -9
- package/dist/components/Quests/WageringQuest/WageringQuestModal.d.ts +0 -9
- package/dist/components/Quests/WageringQuest/WageringQuestModal.js +0 -9
- /package/dist/components/{Empty.d.ts → shared/Empty.d.ts} +0 -0
- /package/dist/components/{Empty.js → shared/Empty.js} +0 -0
- /package/dist/components/{InfiniteScroll.d.ts → shared/InfiniteScroll.d.ts} +0 -0
- /package/dist/components/{InfiniteScroll.js → shared/InfiniteScroll.js} +0 -0
- /package/dist/constants/{endpoints.d.ts → Endpoint.d.ts} +0 -0
- /package/dist/constants/{envVars.d.ts → EnvVar.d.ts} +0 -0
- /package/dist/constants/{envVars.js → EnvVar.js} +0 -0
- /package/dist/constants/{gameProviders.d.ts → GameProvider.d.ts} +0 -0
- /package/dist/constants/{gameProviders.js → GameProvider.js} +0 -0
- /package/dist/constants/{gameTypes.d.ts → GameType.d.ts} +0 -0
- /package/dist/constants/{gameTypes.js → GameType.js} +0 -0
- /package/dist/constants/{headerKeys.d.ts → HeaderKey.d.ts} +0 -0
- /package/dist/constants/{headerKeys.js → HeaderKey.js} +0 -0
- /package/dist/constants/{secretQuestions.d.ts → SecretQuestion.d.ts} +0 -0
- /package/dist/constants/{secretQuestions.js → SecretQuestion.js} +0 -0
- /package/dist/constants/{storageKeys.d.ts → StorageKey.d.ts} +0 -0
- /package/dist/constants/{storageKeys.js → StorageKey.js} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useMutation } from '@tanstack/react-query';
|
|
2
2
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
3
|
-
import { getAuthenticateMutationKey
|
|
3
|
+
import { getAuthenticateMutationKey } from '../../utils/mutationKeys.js';
|
|
4
|
+
import { getSessionQueryKey } from '../../utils/queryKeys.js';
|
|
4
5
|
import { authenticate } from '../services/authenticate.js';
|
|
5
6
|
export const useAuthenticateMutation = (config) => {
|
|
6
7
|
const queryClient = getQueryClient();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Mutation } from '../../types';
|
|
2
|
-
export declare const useCheckInDailyCheckInQuestMutation: Mutation<
|
|
2
|
+
export declare const useCheckInDailyCheckInQuestMutation: Mutation<void, string>;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { useMutation } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { checkInDailyCheckInQuest } from '../../services/trigger.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getCheckInDailyQuestMutationKey } from '../../utils/mutationKeys.js';
|
|
6
|
+
import { parseDecimal } from '../../utils/parseDecimal.js';
|
|
7
|
+
import { getAvailableQuestsQueryKey } from '../../utils/queryKeys.js';
|
|
5
8
|
import { getSession } from '../services/getSession.js';
|
|
6
9
|
export const useCheckInDailyCheckInQuestMutation = (config) => {
|
|
10
|
+
const queryClient = getQueryClient();
|
|
7
11
|
const mutation = useMutation({
|
|
8
12
|
...config,
|
|
9
13
|
mutationKey: getCheckInDailyQuestMutationKey(),
|
|
@@ -15,7 +19,21 @@ export const useCheckInDailyCheckInQuestMutation = (config) => {
|
|
|
15
19
|
Authorization: `Bearer ${session.token}`,
|
|
16
20
|
},
|
|
17
21
|
});
|
|
18
|
-
|
|
22
|
+
queryClient.setQueryData(getAvailableQuestsQueryKey(), (prev) => {
|
|
23
|
+
return prev?.map((quest) => {
|
|
24
|
+
const incrementPercent = 100 / 7;
|
|
25
|
+
const progressPercentage = parseDecimal(quest.progressPercentage, 0) + incrementPercent;
|
|
26
|
+
if (quest.id === id) {
|
|
27
|
+
return {
|
|
28
|
+
...quest,
|
|
29
|
+
status: progressPercentage >= 100 ? 'COMPLETED' : quest.status,
|
|
30
|
+
lastCheckInDate: new Date().toISOString(),
|
|
31
|
+
progressPercentage: progressPercentage.toFixed(2),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return quest;
|
|
35
|
+
});
|
|
36
|
+
});
|
|
19
37
|
},
|
|
20
38
|
});
|
|
21
39
|
return mutation;
|
|
@@ -2,7 +2,8 @@ import { useMutation } from '@tanstack/react-query';
|
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { claimCashbackBonus } from '../../services/wallet.js';
|
|
4
4
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
-
import {
|
|
5
|
+
import { getClaimCashbackBonusMutationKey } from '../../utils/mutationKeys.js';
|
|
6
|
+
import { getCashbackBonusesCountQueryKey, getCashbackBonusesQueryKey, } from '../../utils/queryKeys.js';
|
|
6
7
|
import { getSession } from '../services/getSession.js';
|
|
7
8
|
export const useClaimCashbackBonusMutation = (config) => {
|
|
8
9
|
const queryClient = getQueryClient();
|
|
@@ -2,7 +2,8 @@ import { useMutation } from '@tanstack/react-query';
|
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { claimSpotBonus } from '../../services/wallet.js';
|
|
4
4
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
-
import {
|
|
5
|
+
import { getClaimSpotBonusMutationKey } from '../../utils/mutationKeys.js';
|
|
6
|
+
import { getBonusesQueryKey } from '../../utils/queryKeys.js';
|
|
6
7
|
import { getSession } from '../services/getSession.js';
|
|
7
8
|
export const useClaimSpotBonusMutation = (config) => {
|
|
8
9
|
const queryClient = getQueryClient();
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useMutation } from '@tanstack/react-query';
|
|
2
|
+
import invariant from 'tiny-invariant';
|
|
3
|
+
import { completeOnboarding, } from '../../services/portal.js';
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getCompleteOnboardingMutationKey } from '../../utils/mutationKeys.js';
|
|
6
|
+
import { getOnboardingStatusQueryKey } from '../../utils/queryKeys.js';
|
|
7
|
+
import { getSession } from '../services/getSession.js';
|
|
8
|
+
export const useCompleteOnboardingMutation = (config) => {
|
|
9
|
+
const queryClient = getQueryClient();
|
|
10
|
+
const mutation = useMutation({
|
|
11
|
+
...config,
|
|
12
|
+
mutationKey: getCompleteOnboardingMutationKey(),
|
|
13
|
+
mutationFn: async (input) => {
|
|
14
|
+
const session = await getSession();
|
|
15
|
+
invariant(session.status === 'authenticated');
|
|
16
|
+
await completeOnboarding(input, {
|
|
17
|
+
headers: {
|
|
18
|
+
Authorization: `Bearer ${session.token}`,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
queryClient.setQueryData(getOnboardingStatusQueryKey(), () => 'COMPLETED');
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
return mutation;
|
|
25
|
+
};
|
|
@@ -5,7 +5,8 @@ import { ObjectType } from '../../services/ObjectType.js';
|
|
|
5
5
|
import { createGCashDeposit, getDeposit, } from '../../services/wallet.js';
|
|
6
6
|
import { createPoll } from '../../utils/createPoll.js';
|
|
7
7
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
8
|
-
import { getCreateGCashDepositMutationKey
|
|
8
|
+
import { getCreateGCashDepositMutationKey } from '../../utils/mutationKeys.js';
|
|
9
|
+
import { getDepositsCountQueryKey } from '../../utils/queryKeys.js';
|
|
9
10
|
import { getSession } from '../services/getSession.js';
|
|
10
11
|
export const useCreateGCashDepositMutation = (config) => {
|
|
11
12
|
const queryClient = getQueryClient();
|
|
@@ -3,7 +3,7 @@ import { useMutation } from '@tanstack/react-query';
|
|
|
3
3
|
import invariant from 'tiny-invariant';
|
|
4
4
|
import { ObjectType } from '../../services/ObjectType.js';
|
|
5
5
|
import { createGCashWithdrawal, } from '../../services/wallet.js';
|
|
6
|
-
import { getCreateGCashWithdrawalMutationKey } from '../../utils/
|
|
6
|
+
import { getCreateGCashWithdrawalMutationKey } from '../../utils/mutationKeys.js';
|
|
7
7
|
import { getSession } from '../services/getSession.js';
|
|
8
8
|
export const useCreateGCashWithdrawalMutation = (config) => {
|
|
9
9
|
const mutation = useMutation({
|
|
@@ -6,7 +6,7 @@ import { createGameSession__legacy, getGameSession__legacy, } from '../../servic
|
|
|
6
6
|
import { ObjectType } from '../../services/ObjectType.js';
|
|
7
7
|
import { createGameSession, getGameSession } from '../../services/wallet.js';
|
|
8
8
|
import { createPoll } from '../../utils/createPoll.js';
|
|
9
|
-
import { getCreateGameSessionMutationKey } from '../../utils/
|
|
9
|
+
import { getCreateGameSessionMutationKey } from '../../utils/mutationKeys.js';
|
|
10
10
|
import { getSession } from '../services/getSession.js';
|
|
11
11
|
export const useCreateGameSessionMutation = (config) => {
|
|
12
12
|
return useMutation({
|
|
@@ -3,7 +3,7 @@ import { useMutation } from '@tanstack/react-query';
|
|
|
3
3
|
import invariant from 'tiny-invariant';
|
|
4
4
|
import { ObjectType } from '../../services/ObjectType.js';
|
|
5
5
|
import { createAIOInstapayWithdrawal, } from '../../services/wallet.js';
|
|
6
|
-
import { getCreateInstapayWithdrawalMutationKey } from '../../utils/
|
|
6
|
+
import { getCreateInstapayWithdrawalMutationKey } from '../../utils/mutationKeys.js';
|
|
7
7
|
import { getSession } from '../services/getSession.js';
|
|
8
8
|
export const useCreateInstapayWithdrawalMutation = (config) => {
|
|
9
9
|
const mutation = useMutation({
|
|
@@ -5,7 +5,8 @@ import { ObjectType } from '../../services/ObjectType.js';
|
|
|
5
5
|
import { createMayaAppDeposit, getDeposit, } from '../../services/wallet.js';
|
|
6
6
|
import { createPoll } from '../../utils/createPoll.js';
|
|
7
7
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
8
|
-
import { getCreateMayaAppDepositMutationKey
|
|
8
|
+
import { getCreateMayaAppDepositMutationKey } from '../../utils/mutationKeys.js';
|
|
9
|
+
import { getDepositsCountQueryKey } from '../../utils/queryKeys.js';
|
|
9
10
|
import { getSession } from '../services/getSession.js';
|
|
10
11
|
export const useCreateMayaAppDepositMutation = (config) => {
|
|
11
12
|
const queryClient = getQueryClient();
|
|
@@ -3,7 +3,7 @@ import { useMutation } from '@tanstack/react-query';
|
|
|
3
3
|
import invariant from 'tiny-invariant';
|
|
4
4
|
import { ObjectType } from '../../services/ObjectType.js';
|
|
5
5
|
import { createMayaAppWithdrawal, } from '../../services/wallet.js';
|
|
6
|
-
import { getCreateMayaAppWithdrawalMutationKey } from '../../utils/
|
|
6
|
+
import { getCreateMayaAppWithdrawalMutationKey } from '../../utils/mutationKeys.js';
|
|
7
7
|
import { getSession } from '../services/getSession.js';
|
|
8
8
|
export const useCreateMayaAppWithdrawalMutation = (config) => {
|
|
9
9
|
const mutation = useMutation({
|
|
@@ -5,7 +5,8 @@ import { ObjectType } from '../../services/ObjectType.js';
|
|
|
5
5
|
import { createMayaDeposit, getDeposit, } from '../../services/wallet.js';
|
|
6
6
|
import { createPoll } from '../../utils/createPoll.js';
|
|
7
7
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
8
|
-
import { getCreateMayaDepositMutationKey
|
|
8
|
+
import { getCreateMayaDepositMutationKey } from '../../utils/mutationKeys.js';
|
|
9
|
+
import { getDepositsCountQueryKey } from '../../utils/queryKeys.js';
|
|
9
10
|
import { getSession } from '../services/getSession.js';
|
|
10
11
|
export const useCreateMayaDepositMutation = (config) => {
|
|
11
12
|
const queryClient = getQueryClient();
|
|
@@ -3,7 +3,7 @@ import { useMutation } from '@tanstack/react-query';
|
|
|
3
3
|
import invariant from 'tiny-invariant';
|
|
4
4
|
import { ObjectType } from '../../services/ObjectType.js';
|
|
5
5
|
import { createMayaWithdrawal, } from '../../services/wallet.js';
|
|
6
|
-
import { getCreateMayaWithdrawalMutationKey } from '../../utils/
|
|
6
|
+
import { getCreateMayaWithdrawalMutationKey } from '../../utils/mutationKeys.js';
|
|
7
7
|
import { getSession } from '../services/getSession.js';
|
|
8
8
|
export const useCreateMayaWithdrawalMutation = (config) => {
|
|
9
9
|
const mutation = useMutation({
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SetOptional } from 'type-fest';
|
|
2
|
+
import { type CreateMemberVerificationInput } from '../../services/account';
|
|
3
|
+
import type { Mutation } from '../../types';
|
|
4
|
+
export declare const useCreateMemberVerificationMutation: Mutation<string, SetOptional<CreateMemberVerificationInput, 'id'>>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ObjectId } from '@opexa/object-id';
|
|
2
|
+
import { useMutation } from '@tanstack/react-query';
|
|
3
|
+
import invariant from 'tiny-invariant';
|
|
4
|
+
import { createMemberVerification__next, } from '../../services/account.js';
|
|
5
|
+
import { ObjectType } from '../../services/ObjectType.js';
|
|
6
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
7
|
+
import { getCreateMemberVerificationQueryKey } from '../../utils/mutationKeys.js';
|
|
8
|
+
import { getAccountQueryKey, getMemberVerificationQueryKey, } from '../../utils/queryKeys.js';
|
|
9
|
+
import { getSession } from '../services/getSession.js';
|
|
10
|
+
export const useCreateMemberVerificationMutation = (config) => {
|
|
11
|
+
const queryClient = getQueryClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
...config,
|
|
14
|
+
mutationKey: getCreateMemberVerificationQueryKey(),
|
|
15
|
+
mutationFn: async (data) => {
|
|
16
|
+
const session = await getSession();
|
|
17
|
+
invariant(session.status === 'authenticated');
|
|
18
|
+
const id = data.id ?? ObjectId.generate(ObjectType.MemberVerification).toString();
|
|
19
|
+
await createMemberVerification__next({ ...data, id }, {
|
|
20
|
+
headers: {
|
|
21
|
+
Authorization: `Bearer ${session.token}`,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
queryClient.setQueryData(getMemberVerificationQueryKey(), () => {
|
|
25
|
+
return {
|
|
26
|
+
id,
|
|
27
|
+
...data,
|
|
28
|
+
status: 'PENDING',
|
|
29
|
+
selfieImage: { id: data.selfieImage, status: 'UPLOADING' },
|
|
30
|
+
idFrontImage: { id: data.idFrontImage, status: 'UPLOADING' },
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
queryClient.setQueryData(getAccountQueryKey(), (prev) => {
|
|
34
|
+
if (!prev)
|
|
35
|
+
return prev;
|
|
36
|
+
return {
|
|
37
|
+
...prev,
|
|
38
|
+
verificationStatus: 'PENDING',
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
return id;
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
return mutation;
|
|
45
|
+
};
|
|
@@ -5,7 +5,8 @@ import { ObjectType } from '../../services/ObjectType.js';
|
|
|
5
5
|
import { createAIOOnlineBankDeposit, getDeposit, } from '../../services/wallet.js';
|
|
6
6
|
import { createPoll } from '../../utils/createPoll.js';
|
|
7
7
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
8
|
-
import { getCreateOnlineBankDepositMutationKey
|
|
8
|
+
import { getCreateOnlineBankDepositMutationKey } from '../../utils/mutationKeys.js';
|
|
9
|
+
import { getDepositsCountQueryKey } from '../../utils/queryKeys.js';
|
|
9
10
|
import { getSession } from '../services/getSession.js';
|
|
10
11
|
export const useCreateOnlineBankDepositMutation = (config) => {
|
|
11
12
|
const queryClient = getQueryClient();
|
|
@@ -5,7 +5,8 @@ import { ObjectType } from '../../services/ObjectType.js';
|
|
|
5
5
|
import { createAIOQRPHDeposit, getDeposit, } from '../../services/wallet.js';
|
|
6
6
|
import { createPoll } from '../../utils/createPoll.js';
|
|
7
7
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
8
|
-
import { getCreateQRPHDepositMutationKey
|
|
8
|
+
import { getCreateQRPHDepositMutationKey } from '../../utils/mutationKeys.js';
|
|
9
|
+
import { getDepositsCountQueryKey } from '../../utils/queryKeys.js';
|
|
9
10
|
import { getSession } from '../services/getSession.js';
|
|
10
11
|
export const useCreateQRPHDepositMutation = (config) => {
|
|
11
12
|
const queryClient = getQueryClient();
|
|
@@ -3,7 +3,7 @@ import invariant from 'tiny-invariant';
|
|
|
3
3
|
import { LEGACY_GAME_PROVIDERS } from '../../constants/index.js';
|
|
4
4
|
import { endGameSession__legacy } from '../../services/game.js';
|
|
5
5
|
import { endGameSession } from '../../services/wallet.js';
|
|
6
|
-
import { getEndGameSessionMutationKey } from '../../utils/
|
|
6
|
+
import { getEndGameSessionMutationKey } from '../../utils/mutationKeys.js';
|
|
7
7
|
import { getSession } from '../services/getSession.js';
|
|
8
8
|
export const useEndGameSessionMutation = (config) => {
|
|
9
9
|
return useMutation({
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { getFile } from '../../services/file.js';
|
|
3
|
+
import { getFileQueryKey } from '../../utils/queryKeys.js';
|
|
4
|
+
import { getSession } from '../services/getSession.js';
|
|
5
|
+
import { useSessionQuery } from './useSessionQuery.js';
|
|
6
|
+
export const useFileQuery = (id, config) => {
|
|
7
|
+
const sessionQuery = useSessionQuery();
|
|
8
|
+
const query = useQuery({
|
|
9
|
+
...config,
|
|
10
|
+
enabled: !id
|
|
11
|
+
? false
|
|
12
|
+
: config?.enabled === false
|
|
13
|
+
? false
|
|
14
|
+
: sessionQuery.data?.status === 'authenticated',
|
|
15
|
+
queryKey: getFileQueryKey(id),
|
|
16
|
+
queryFn: async ({ signal }) => {
|
|
17
|
+
const session = await getSession();
|
|
18
|
+
const file = await getFile(id, {
|
|
19
|
+
signal,
|
|
20
|
+
...(session.status === 'authenticated' && {
|
|
21
|
+
headers: {
|
|
22
|
+
Authorization: `Bearer ${session.token}`,
|
|
23
|
+
},
|
|
24
|
+
}),
|
|
25
|
+
});
|
|
26
|
+
return file ?? null;
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
return query;
|
|
30
|
+
};
|
|
@@ -3,7 +3,8 @@ import invariant from 'tiny-invariant';
|
|
|
3
3
|
import { getSession } from '../../client/services/getSession.js';
|
|
4
4
|
import { markGameAsFavorite } from '../../services/wallet.js';
|
|
5
5
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
6
|
-
import {
|
|
6
|
+
import { getMarkGameAsFavoriteMutationKey } from '../../utils/mutationKeys.js';
|
|
7
|
+
import { getFavoriteGamesQueryKey, getGamesQueryKey, } from '../../utils/queryKeys.js';
|
|
7
8
|
export const useMarkGameAsFavoriteMutation = (config) => {
|
|
8
9
|
const queryClient = getQueryClient();
|
|
9
10
|
const mutation = useMutation({
|
|
@@ -17,12 +18,30 @@ export const useMarkGameAsFavoriteMutation = (config) => {
|
|
|
17
18
|
Authorization: `Bearer ${session.token}`,
|
|
18
19
|
},
|
|
19
20
|
});
|
|
21
|
+
const games = queryClient
|
|
22
|
+
.getQueriesData({
|
|
23
|
+
queryKey: getGamesQueryKey({}),
|
|
24
|
+
})
|
|
25
|
+
.map(([, arr]) => arr)
|
|
26
|
+
.filter(Boolean)
|
|
27
|
+
.map((obj) => obj.pages.map((q) => q.edges.map((edge) => edge.node)).flat())
|
|
28
|
+
.flat();
|
|
29
|
+
const game = games.find((game) => game.reference === id);
|
|
30
|
+
queryClient.setQueryData(getFavoriteGamesQueryKey(), (prev = []) => {
|
|
31
|
+
if (game) {
|
|
32
|
+
return [
|
|
33
|
+
...prev,
|
|
34
|
+
{
|
|
35
|
+
id: game.reference,
|
|
36
|
+
name: game.name,
|
|
37
|
+
type: game.type,
|
|
38
|
+
provider: game.provider,
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
}
|
|
42
|
+
});
|
|
20
43
|
return id;
|
|
21
44
|
},
|
|
22
|
-
onSuccess: () => {
|
|
23
|
-
queryClient.invalidateQueries({ queryKey: getGamesQueryKey({}) });
|
|
24
|
-
queryClient.invalidateQueries({ queryKey: getFavoriteGamesQueryKey() });
|
|
25
|
-
},
|
|
26
45
|
});
|
|
27
46
|
return mutation;
|
|
28
47
|
};
|
|
@@ -2,7 +2,8 @@ import { useMutation } from '@tanstack/react-query';
|
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { markMessageAsRead } from '../../services/trigger.js';
|
|
4
4
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
-
import { getMarkMessageAsReadMutationKey
|
|
5
|
+
import { getMarkMessageAsReadMutationKey } from '../../utils/mutationKeys.js';
|
|
6
|
+
import { getMessagesQueryKey, getUnreadMessagesCountQueryKey, } from '../../utils/queryKeys.js';
|
|
6
7
|
import { getSession } from '../services/getSession.js';
|
|
7
8
|
export const useMarkMessageAsReadMutation = (config) => {
|
|
8
9
|
const queryClient = getQueryClient();
|
|
@@ -17,13 +18,21 @@ export const useMarkMessageAsReadMutation = (config) => {
|
|
|
17
18
|
Authorization: `Bearer ${session.token}`,
|
|
18
19
|
},
|
|
19
20
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
queryClient.setQueryData(getMessagesQueryKey(), (prev) => {
|
|
22
|
+
return prev?.map((message) => {
|
|
23
|
+
if (message.id === id) {
|
|
24
|
+
return {
|
|
25
|
+
...message,
|
|
26
|
+
markedAsRead: true,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return message;
|
|
30
|
+
});
|
|
26
31
|
});
|
|
32
|
+
queryClient.setQueryData(getUnreadMessagesCountQueryKey(), (prev) => {
|
|
33
|
+
return prev && prev > 0 ? prev - 1 : 0;
|
|
34
|
+
});
|
|
35
|
+
return id;
|
|
27
36
|
},
|
|
28
37
|
});
|
|
29
38
|
return mutation;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import invariant from 'tiny-invariant';
|
|
3
|
+
import { getOnboardingStatus } from '../../services/portal.js';
|
|
4
|
+
import { getOnboardingStatusQueryKey } from '../../utils/queryKeys.js';
|
|
5
|
+
import { getSession } from '../services/getSession.js';
|
|
6
|
+
import { useSessionQuery } from './useSessionQuery.js';
|
|
7
|
+
export const useOnboardingStatusQuery = (config) => {
|
|
8
|
+
const sessionQuery = useSessionQuery();
|
|
9
|
+
const query = useQuery({
|
|
10
|
+
...config,
|
|
11
|
+
enabled: config?.enabled === false
|
|
12
|
+
? false
|
|
13
|
+
: sessionQuery.data?.status === 'authenticated',
|
|
14
|
+
queryKey: getOnboardingStatusQueryKey(),
|
|
15
|
+
queryFn: async ({ signal }) => {
|
|
16
|
+
const session = await getSession();
|
|
17
|
+
invariant(session.status === 'authenticated');
|
|
18
|
+
const status = await getOnboardingStatus({
|
|
19
|
+
signal,
|
|
20
|
+
headers: {
|
|
21
|
+
Authorization: `Bearer ${session.token}`,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
return status ?? null;
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
return query;
|
|
28
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import invariant from 'tiny-invariant';
|
|
3
|
+
import { getRecommendedGames } from '../../services/portal.js';
|
|
4
|
+
import { getOnboardingStatusQueryKey } from '../../utils/queryKeys.js';
|
|
5
|
+
import { getSession } from '../services/getSession.js';
|
|
6
|
+
import { useSessionQuery } from './useSessionQuery.js';
|
|
7
|
+
export const useRecommendedGamesQuery = (config) => {
|
|
8
|
+
const sessionQuery = useSessionQuery();
|
|
9
|
+
const query = useQuery({
|
|
10
|
+
...config,
|
|
11
|
+
enabled: config?.enabled === false
|
|
12
|
+
? false
|
|
13
|
+
: sessionQuery.data?.status === 'authenticated',
|
|
14
|
+
queryKey: getOnboardingStatusQueryKey(),
|
|
15
|
+
queryFn: async ({ signal }) => {
|
|
16
|
+
const session = await getSession();
|
|
17
|
+
invariant(session.status === 'authenticated');
|
|
18
|
+
return await getRecommendedGames({
|
|
19
|
+
signal,
|
|
20
|
+
headers: {
|
|
21
|
+
Authorization: `Bearer ${session.token}`,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
return query;
|
|
27
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMutation } from '@tanstack/react-query';
|
|
2
2
|
import { sendVerificationCode, } from '../../services/auth.js';
|
|
3
|
-
import { getSendVerificationCodeMutationKey } from '../../utils/
|
|
3
|
+
import { getSendVerificationCodeMutationKey } from '../../utils/mutationKeys.js';
|
|
4
4
|
export const useSendVerificationCodeMutation = (config) => {
|
|
5
5
|
return useMutation({
|
|
6
6
|
...config,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useMutation } from '@tanstack/react-query';
|
|
2
2
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
3
|
-
import {
|
|
3
|
+
import { getSignInMutationKey } from '../../utils/mutationKeys.js';
|
|
4
|
+
import { getSessionQueryKey } from '../../utils/queryKeys.js';
|
|
4
5
|
import { signIn } from '../services/signIn.js';
|
|
5
6
|
export const useSignInMutation = (config) => {
|
|
6
7
|
const queryClient = getQueryClient();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useMutation } from '@tanstack/react-query';
|
|
2
2
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
3
|
-
import {
|
|
3
|
+
import { getSignOutMutationKey } from '../../utils/mutationKeys.js';
|
|
4
|
+
import { getSessionQueryKey } from '../../utils/queryKeys.js';
|
|
4
5
|
import { signOut } from '../services/signOut.js';
|
|
5
6
|
export const useSignOutMutation = (config) => {
|
|
6
7
|
const queryClient = getQueryClient();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMutation } from '@tanstack/react-query';
|
|
2
2
|
import { registerMemberAccountViaMobile, } from '../../services/account.js';
|
|
3
|
-
import { getSignUpMutationKey } from '../../utils/
|
|
3
|
+
import { getSignUpMutationKey } from '../../utils/mutationKeys.js';
|
|
4
4
|
export const useSignUpMutation = (config) => {
|
|
5
5
|
return useMutation({
|
|
6
6
|
...config,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import invariant from 'tiny-invariant';
|
|
3
|
+
import { SITE_ID } from '../../constants/index.js';
|
|
4
|
+
import { getSite } from '../../services/cmsPortal.js';
|
|
5
|
+
import { getSiteQueryKey } from '../../utils/queryKeys.js';
|
|
6
|
+
export const useSiteQuery = (config) => {
|
|
7
|
+
return useQuery({
|
|
8
|
+
...config,
|
|
9
|
+
queryKey: getSiteQueryKey(),
|
|
10
|
+
queryFn: async ({ signal }) => {
|
|
11
|
+
const site = await getSite(SITE_ID, { signal });
|
|
12
|
+
invariant(site);
|
|
13
|
+
return site;
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useMutation } from '@tanstack/react-query';
|
|
2
|
+
import invariant from 'tiny-invariant';
|
|
3
|
+
import { skipOnboarding } from '../../services/portal.js';
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getSkipOnboardingMutationKey } from '../../utils/mutationKeys.js';
|
|
6
|
+
import { getOnboardingStatusQueryKey } from '../../utils/queryKeys.js';
|
|
7
|
+
import { getSession } from '../services/getSession.js';
|
|
8
|
+
export const useSkipOnboardingMutation = (config) => {
|
|
9
|
+
const queryClient = getQueryClient();
|
|
10
|
+
const mutation = useMutation({
|
|
11
|
+
...config,
|
|
12
|
+
mutationKey: getSkipOnboardingMutationKey(),
|
|
13
|
+
mutationFn: async () => {
|
|
14
|
+
const session = await getSession();
|
|
15
|
+
invariant(session.status === 'authenticated');
|
|
16
|
+
await skipOnboarding({
|
|
17
|
+
headers: {
|
|
18
|
+
Authorization: `Bearer ${session.token}`,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
queryClient.setQueryData(getOnboardingStatusQueryKey(), () => 'SKIPPED');
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
return mutation;
|
|
25
|
+
};
|
|
@@ -2,7 +2,8 @@ import { useMutation } from '@tanstack/react-query';
|
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { unmarkGameAsFavorite } from '../../services/wallet.js';
|
|
4
4
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
-
import {
|
|
5
|
+
import { getUnmarkGameAsFavoriteMutationKey } from '../../utils/mutationKeys.js';
|
|
6
|
+
import { getFavoriteGamesQueryKey } from '../../utils/queryKeys.js';
|
|
6
7
|
import { getSession } from '../services/getSession.js';
|
|
7
8
|
export const useUnmarkGameAsFavoriteMutation = (config) => {
|
|
8
9
|
const queryClient = getQueryClient();
|
|
@@ -17,10 +18,9 @@ export const useUnmarkGameAsFavoriteMutation = (config) => {
|
|
|
17
18
|
Authorization: `Bearer ${session.token}`,
|
|
18
19
|
},
|
|
19
20
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
queryClient.invalidateQueries({ queryKey: getFavoriteGamesQueryKey() });
|
|
21
|
+
queryClient.setQueryData(getFavoriteGamesQueryKey(), (prev) => {
|
|
22
|
+
return prev?.filter((game) => game.id !== id);
|
|
23
|
+
});
|
|
24
24
|
},
|
|
25
25
|
});
|
|
26
26
|
return mutation;
|
|
@@ -2,7 +2,8 @@ import { useMutation } from '@tanstack/react-query';
|
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { updateMemberAccount, } from '../../services/account.js';
|
|
4
4
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
-
import {
|
|
5
|
+
import { getUpdateAccountMutationKey } from '../../utils/mutationKeys.js';
|
|
6
|
+
import { getAccountQueryKey, getProfileCompletionQueryKey, } from '../../utils/queryKeys.js';
|
|
6
7
|
import { getSession } from '../services/getSession.js';
|
|
7
8
|
import { useAccountQuery } from './useAccountQuery.js';
|
|
8
9
|
export const useUpdateAccountMutation = (config) => {
|