Skip to content

Commit

Permalink
fix: pass in otp code
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Jan 18, 2025
1 parent 8385500 commit ac29a18
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion apps/renderer/src/modules/discover/list-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,20 @@ 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({
json: {
address,
amount: amountBigInt.toString(),
toRss3,
TOTPCode,
},
})
},
Expand Down
2 changes: 1 addition & 1 deletion apps/renderer/src/queries/rsshub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit ac29a18

Please sign in to comment.