mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-09-05 07:27:27 +08:00
fix: delete_address not delete address_sender (#153)
This commit is contained in:
@@ -8,6 +8,7 @@ on:
|
|||||||
- main
|
- main
|
||||||
tags:
|
tags:
|
||||||
- "*"
|
- "*"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ onMounted(async () => {
|
|||||||
<template>
|
<template>
|
||||||
<n-config-provider :locale="localeConfig" :theme="theme">
|
<n-config-provider :locale="localeConfig" :theme="theme">
|
||||||
<n-global-style />
|
<n-global-style />
|
||||||
<n-spin description="loading..." :show="loading">
|
<n-spin description="loading..." :show="loading" style="z-index: 9999;">
|
||||||
<n-message-provider>
|
<n-message-provider>
|
||||||
<n-grid x-gap="12" :cols="12">
|
<n-grid x-gap="12" :cols="12">
|
||||||
<n-gi v-if="!isMobile" span="1"></n-gi>
|
<n-gi v-if="!isMobile" span="1"></n-gi>
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ const deleteEmail = async () => {
|
|||||||
await fetchData()
|
await fetchData()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
message.error(error.message || "error");
|
message.error(error.message || "error");
|
||||||
|
showDelteAccount.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,7 +215,7 @@ onMounted(async () => {
|
|||||||
<template #action>
|
<template #action>
|
||||||
</template>
|
</template>
|
||||||
</n-modal>
|
</n-modal>
|
||||||
<n-modal v-model:show="showDelteAccount" preset="dialog" title="Dialog">
|
<n-modal v-model:show="showDelteAccount" preset="dialog" :title="t('delteAccount')">
|
||||||
<p>{{ t('deleteTip') }}</p>
|
<p>{{ t('deleteTip') }}</p>
|
||||||
<template #action>
|
<template #action>
|
||||||
<n-button @click="deleteEmail" size="small" tertiary round type="error">
|
<n-button @click="deleteEmail" size="small" tertiary round type="error">
|
||||||
|
|||||||
@@ -66,8 +66,11 @@ api.delete('/admin/delete_address/:id', async (c) => {
|
|||||||
if (!mailSuccess) {
|
if (!mailSuccess) {
|
||||||
return c.text("Failed to delete mails", 500)
|
return c.text("Failed to delete mails", 500)
|
||||||
}
|
}
|
||||||
|
const { success: sendAccess } = await c.env.DB.prepare(
|
||||||
|
`DELETE FROM address_sender WHERE address_id = ? `
|
||||||
|
).bind(id).run();
|
||||||
return c.json({
|
return c.json({
|
||||||
success: success
|
success: success && mailSuccess && sendAccess
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -220,8 +220,11 @@ api.delete('/api/delete_address', async (c) => {
|
|||||||
if (!mailSuccess) {
|
if (!mailSuccess) {
|
||||||
return c.text("Failed to delete mails", 500)
|
return c.text("Failed to delete mails", 500)
|
||||||
}
|
}
|
||||||
|
const { success: sendAccess } = await c.env.DB.prepare(
|
||||||
|
`DELETE FROM address_sender WHERE address = ? `
|
||||||
|
).bind(address).run();
|
||||||
return c.json({
|
return c.json({
|
||||||
success: success
|
success: success && mailSuccess && sendAccess
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user