Fix time nonsense with new et striked
This commit is contained in:
@@ -19,14 +19,13 @@ export async function onRequestPost(context: RequestContext) {
|
||||
)
|
||||
return jsonError("Invalid user id", 400);
|
||||
|
||||
const now = Date.now();
|
||||
const id = crypto.randomUUID().replaceAll("-", "");
|
||||
const actingUser = context.data.current_user.id;
|
||||
|
||||
await D1.batch([
|
||||
D1.prepare(
|
||||
"INSERT INTO et_strikes (created_at, created_by, id, reason, user) VALUES (?, ?, ?, ?, ?);",
|
||||
).bind(now, actingUser, id, reason, user),
|
||||
"INSERT INTO et_strikes (created_by, id, reason, user) VALUES (?, ?, ?, ?);",
|
||||
).bind(actingUser, id, reason, user),
|
||||
D1.prepare(
|
||||
"UPDATE et_members SET points = points - 100 WHERE id = ?;",
|
||||
).bind(user),
|
||||
|
||||
Reference in New Issue
Block a user