feature: update address updated_at in multi api (#675)

This commit is contained in:
Dream Hunter
2025-06-21 01:41:28 +08:00
committed by GitHub
parent da5482e095
commit 483c429feb
2 changed files with 36 additions and 9 deletions

View File

@@ -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,