fix: pass in otp code

This commit is contained in:
DIYgod
2025-01-18 13:59:21 +08:00
parent 8385500c4b
commit ac29a18135
3 changed files with 6 additions and 2 deletions
@@ -208,13 +208,14 @@ const ListInnerForm = ({
}, [subscription])
const followMutation = useMutation({
mutationFn: async (values: z.infer<typeof formSchema>) => {
mutationFn: async (values: z.infer<typeof formSchema> & { TOTPCode?: string }) => {
const body = {
listId: list.id,
view: Number.parseInt(values.view),
category: values.category,
isPrivate: values.isPrivate,
title: values.title,
TOTPCode: values.TOTPCode,
}
const $method = isSubscribed ? apiClient.subscriptions.$patch : apiClient.subscriptions.$post
@@ -73,10 +73,12 @@ const WithdrawModalContent = ({ dismiss }: { dismiss: () => void }) => {
address,
amount,
toRss3,
TOTPCode,
}: {
address: string
amount: number
toRss3?: boolean
TOTPCode?: string
}) => {
const amountBigInt = from(amount, 18)[0]
await apiClient.wallets.transactions.withdraw.$post({
@@ -84,6 +86,7 @@ const WithdrawModalContent = ({ dismiss }: { dismiss: () => void }) => {
address,
amount: amountBigInt.toString(),
toRss3,
TOTPCode,
},
})
},
+1 -1
View File
@@ -9,7 +9,7 @@ import type { MutationBaseProps } from "./types"
export const useSetRSSHubMutation = ({ onError }: MutationBaseProps = {}) =>
useMutation({
mutationFn: (data: { id: string | null; durationInMonths?: number }) =>
mutationFn: (data: { id: string | null; durationInMonths?: number; TOTPCode?: string }) =>
apiClient.rsshub.use.$post({ json: data }),
onSuccess: (_, variables) => {