mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-08-19 14:04:03 +08:00
feature: update address updated_at in multi api (#675)
This commit is contained in:
@@ -64,6 +64,16 @@ export default {
|
||||
exp: Math.floor(Date.now() / 1000) + 30 * 24 * 60 * 60,
|
||||
iat: Math.floor(Date.now() / 1000),
|
||||
}, c.env.JWT_SECRET, "HS256");
|
||||
// update address updated_at
|
||||
try {
|
||||
c.env.DB.prepare(
|
||||
`UPDATE address SET updated_at = datetime('now') where id IN `
|
||||
+ `(SELECT address_id FROM users_address WHERE user_id = ?)`
|
||||
).bind(user.user_id).run();
|
||||
|
||||
} catch (e) {
|
||||
console.warn("Failed to update address updated_at")
|
||||
}
|
||||
return c.json({
|
||||
...user,
|
||||
is_admin: is_admin,
|
||||
|
||||
Reference in New Issue
Block a user