Fix time nonsense with new et striked

This commit is contained in:
2026-06-02 18:15:05 -04:00
parent 73b6c85171
commit cc79d29c8e

View File

@@ -19,14 +19,13 @@ export async function onRequestPost(context: RequestContext) {
) )
return jsonError("Invalid user id", 400); return jsonError("Invalid user id", 400);
const now = Date.now();
const id = crypto.randomUUID().replaceAll("-", ""); const id = crypto.randomUUID().replaceAll("-", "");
const actingUser = context.data.current_user.id; const actingUser = context.data.current_user.id;
await D1.batch([ await D1.batch([
D1.prepare( D1.prepare(
"INSERT INTO et_strikes (created_at, created_by, id, reason, user) VALUES (?, ?, ?, ?, ?);", "INSERT INTO et_strikes (created_by, id, reason, user) VALUES (?, ?, ?, ?);",
).bind(now, actingUser, id, reason, user), ).bind(actingUser, id, reason, user),
D1.prepare( D1.prepare(
"UPDATE et_members SET points = points - 100 WHERE id = ?;", "UPDATE et_members SET points = points - 100 WHERE id = ?;",
).bind(user), ).bind(user),