From 7afc6ec25e546f3ae7ae78f36e1d0e47d2719501 Mon Sep 17 00:00:00 2001 From: Noa Virellia Date: Thu, 5 Feb 2026 19:19:48 +0800 Subject: [PATCH] fix(client): shit apiVersion everywhere Signed-off-by: Noa Virellia --- client/cms/src/components/login-form.tsx | 3 ++- .../src/components/profile/edit-profile.dialog.container.tsx | 3 ++- client/cms/src/components/profile/profile.container.tsx | 3 ++- client/cms/src/lib/token.ts | 2 ++ client/cms/src/routes/authorize.tsx | 2 ++ client/cms/src/routes/token.tsx | 3 ++- client/cms/src/stories/events/kyc-dialog.stories.tsx | 5 +++++ 7 files changed, 17 insertions(+), 4 deletions(-) diff --git a/client/cms/src/components/login-form.tsx b/client/cms/src/components/login-form.tsx index 5447440..68afe8e 100644 --- a/client/cms/src/components/login-form.tsx +++ b/client/cms/src/components/login-form.tsx @@ -13,6 +13,7 @@ import { } from '@/components/ui/field'; import { Input } from '@/components/ui/input'; import { useGetMagicLink } from '@/hooks/data/useGetMagicLink'; +import { ver } from '@/lib/apiVersion'; import { cn } from '@/lib/utils'; export function LoginForm({ @@ -32,7 +33,7 @@ export function LoginForm({ event.preventDefault(); const formData = new FormData(formRef.current!); const email = formData.get('email')! as string; - mutateAsync({ body: { email, turnstile_token: token!, ...oauthParams } }).then(() => { + mutateAsync({ body: { email, turnstile_token: token!, ...oauthParams }, headers: ver('20260205') }).then(() => { void navigate({ to: '/magicLinkSent', search: { email } }); }).catch((error) => { console.error(error); diff --git a/client/cms/src/components/profile/edit-profile.dialog.container.tsx b/client/cms/src/components/profile/edit-profile.dialog.container.tsx index 53cd883..d8ade1b 100644 --- a/client/cms/src/components/profile/edit-profile.dialog.container.tsx +++ b/client/cms/src/components/profile/edit-profile.dialog.container.tsx @@ -1,5 +1,6 @@ import type { ServiceUserUserInfoData } from '@/client'; import { useUpdateUser } from '@/hooks/data/useUpdateUser'; +import { ver } from '@/lib/apiVersion'; import { EditProfileDialogView } from './edit-profile.dialog.view'; export function EditProfileDialogContainer({ data }: { data: ServiceUserUserInfoData }) { @@ -8,7 +9,7 @@ export function EditProfileDialogContainer({ data }: { data: ServiceUserUserInfo { - await mutateAsync({ body: data }); + await mutateAsync({ body: data, headers: ver('20260205') }); }} /> ); diff --git a/client/cms/src/components/profile/profile.container.tsx b/client/cms/src/components/profile/profile.container.tsx index c82593e..38afb2d 100644 --- a/client/cms/src/components/profile/profile.container.tsx +++ b/client/cms/src/components/profile/profile.container.tsx @@ -1,5 +1,6 @@ import { useUpdateUser } from '@/hooks/data/useUpdateUser'; import { useOtherUserInfo } from '@/hooks/data/useUserInfo'; +import { ver } from '@/lib/apiVersion'; import { utf8ToBase64 } from '@/lib/utils'; import { ProfileView } from './profile.view'; @@ -10,7 +11,7 @@ export function ProfileContainer({ userId }: { userId: string }) { { - await mutateAsync({ body: { bio: utf8ToBase64(bio) } }); + await mutateAsync({ body: { bio: utf8ToBase64(bio) }, headers: ver('20260205') }); }} /> ); diff --git a/client/cms/src/lib/token.ts b/client/cms/src/lib/token.ts index d491945..6354075 100644 --- a/client/cms/src/lib/token.ts +++ b/client/cms/src/lib/token.ts @@ -1,6 +1,7 @@ import type { ServiceAuthTokenResponse } from '@/client'; import { toast } from 'sonner'; import { postAuthRefresh } from '@/client'; +import { ver } from './apiVersion'; import { router } from './router'; const ACCESS_TOKEN_LOCALSTORAGE_KEY = 'token'; @@ -40,6 +41,7 @@ export async function doRefreshToken(refreshToken: string): Promise { if (mutation.isIdle) { - mutation.mutate({ body: { code } }); + mutation.mutate({ body: { code }, headers: ver('20260205') }); } // eslint-disable-next-line react-hooks/exhaustive-deps }, []); diff --git a/client/cms/src/stories/events/kyc-dialog.stories.tsx b/client/cms/src/stories/events/kyc-dialog.stories.tsx index f2c04ad..6314dbe 100644 --- a/client/cms/src/stories/events/kyc-dialog.stories.tsx +++ b/client/cms/src/stories/events/kyc-dialog.stories.tsx @@ -23,29 +23,34 @@ type Story = StoryObj; export const Prompt: Story = { args: { + next: () => { }, }, }; export const MethodSelection: Story = { render: () => Promise.resolve()} />, args: { + next: () => { }, }, }; export const Pending: Story = { render: () => , args: { + next: () => { }, }, }; export const Success: Story = { render: () => , args: { + next: () => { }, }, }; export const Failed: Story = { render: () => , args: { + next: () => { }, }, };