correct api of email sending

This commit is contained in:
JzoNg
2025-07-14 17:41:07 +08:00
parent 7bf8186f6f
commit 920db45216
2 changed files with 5 additions and 6 deletions

View File

@@ -52,10 +52,9 @@ const TransferOwnershipModal = ({ onClose, show }: Props) => {
const sendEmail = async () => {
try {
const res = await sendOwnerEmail(
userProfile.id,
{},
)
const res = await sendOwnerEmail({
language: userProfile.interface_language,
})
startCount()
if (res.data)
setStepToken(res.data)

View File

@@ -131,8 +131,8 @@ export const deleteMemberOrCancelInvitation: Fetcher<CommonResponse, { url: stri
return del<CommonResponse>(url)
}
export const sendOwnerEmail = (memberID: string, body: { language?: string }) =>
post<CommonResponse & { data: string }>(`/workspaces/current/members/${memberID}/send-owner-transfer-confirm-email`, { body })
export const sendOwnerEmail = (body: { language?: string }) =>
post<CommonResponse & { data: string }>('/workspaces/current/members/send-owner-transfer-confirm-email', { body })
export const verifyOwnerEmail = (body: { code: string; token: string }) =>
post<CommonResponse & { is_valid: boolean; email: string; token: string }>('/workspaces/current/members/owner-transfer-check', { body })