fix(client): shit apiVersion everywhere
Signed-off-by: Noa Virellia <noa@requiem.garden>
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
<EditProfileDialogView
|
||||
user={data}
|
||||
updateProfile={async (data) => {
|
||||
await mutateAsync({ body: data });
|
||||
await mutateAsync({ body: data, headers: ver('20260205') });
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -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 }) {
|
||||
<ProfileView
|
||||
user={data.data!}
|
||||
onSaveBio={async (bio) => {
|
||||
await mutateAsync({ body: { bio: utf8ToBase64(bio) } });
|
||||
await mutateAsync({ body: { bio: utf8ToBase64(bio) }, headers: ver('20260205') });
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -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<ServiceAuthT
|
||||
body: {
|
||||
refresh_token: refreshToken,
|
||||
},
|
||||
headers: ver('20260205'),
|
||||
});
|
||||
return data?.data;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import { useEffect } from 'react';
|
||||
import z from 'zod';
|
||||
import { LoginForm } from '@/components/login-form';
|
||||
import { useExchangeToken } from '@/hooks/data/useExchangeToken';
|
||||
import { ver } from '@/lib/apiVersion';
|
||||
import { generateOAuthState } from '@/lib/random';
|
||||
import { getAccessToken } from '@/lib/token';
|
||||
|
||||
@@ -39,6 +40,7 @@ function RouteComponent() {
|
||||
redirect_uri: oauthParams.redirect_uri,
|
||||
state: oauthParams.state,
|
||||
},
|
||||
headers: ver('20260205'),
|
||||
});
|
||||
}
|
||||
}, [token, mutation.isIdle, mutation, oauthParams.client_id, oauthParams.redirect_uri, oauthParams.state]);
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
} from 'react';
|
||||
import z from 'zod';
|
||||
import { postAuthTokenMutation } from '@/client/@tanstack/react-query.gen';
|
||||
import { ver } from '@/lib/apiVersion';
|
||||
import { setAccessToken, setRefreshToken } from '@/lib/token';
|
||||
|
||||
const tokenCodeSchema = z.object({
|
||||
@@ -36,7 +37,7 @@ function RouteComponent() {
|
||||
|
||||
useEffect(() => {
|
||||
if (mutation.isIdle) {
|
||||
mutation.mutate({ body: { code } });
|
||||
mutation.mutate({ body: { code }, headers: ver('20260205') });
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
@@ -23,29 +23,34 @@ type Story = StoryObj<typeof meta>;
|
||||
|
||||
export const Prompt: Story = {
|
||||
args: {
|
||||
next: () => { },
|
||||
},
|
||||
};
|
||||
|
||||
export const MethodSelection: Story = {
|
||||
render: () => <KycMethodSelectionDialogView onSubmit={async () => Promise.resolve()} />,
|
||||
args: {
|
||||
next: () => { },
|
||||
},
|
||||
};
|
||||
|
||||
export const Pending: Story = {
|
||||
render: () => <KycPendingDialogView />,
|
||||
args: {
|
||||
next: () => { },
|
||||
},
|
||||
};
|
||||
|
||||
export const Success: Story = {
|
||||
render: () => <KycSuccessDialogView />,
|
||||
args: {
|
||||
next: () => { },
|
||||
},
|
||||
};
|
||||
|
||||
export const Failed: Story = {
|
||||
render: () => <KycFailedDialogView />,
|
||||
args: {
|
||||
next: () => { },
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user