mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-09-05 23:47:50 +08:00
fix: admin/delete_address (#195)
This commit is contained in:
@@ -73,14 +73,15 @@ api.delete('/admin/delete_address/:id', async (c) => {
|
|||||||
return c.text("Failed to delete address", 500)
|
return c.text("Failed to delete address", 500)
|
||||||
}
|
}
|
||||||
const { success: mailSuccess } = await c.env.DB.prepare(
|
const { success: mailSuccess } = await c.env.DB.prepare(
|
||||||
`DELETE FROM mails WHERE address IN
|
`DELETE FROM mails WHERE address IN`
|
||||||
(select name from address where id = ?) `
|
+ ` (select name from address where id = ?) `
|
||||||
).bind(id).run();
|
).bind(id).run();
|
||||||
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(
|
const { success: sendAccess } = await c.env.DB.prepare(
|
||||||
`DELETE FROM address_sender WHERE address_id = ? `
|
`DELETE FROM address_sender WHERE address IN`
|
||||||
|
+ ` (select name from address where id = ?) `
|
||||||
).bind(id).run();
|
).bind(id).run();
|
||||||
return c.json({
|
return c.json({
|
||||||
success: success && mailSuccess && sendAccess
|
success: success && mailSuccess && sendAccess
|
||||||
|
|||||||
Reference in New Issue
Block a user