From 2fd9394ef3c4ff0dac480af035075bd6e52681ee Mon Sep 17 00:00:00 2001 From: mia Date: Wed, 28 Aug 2024 00:18:38 -0600 Subject: [PATCH] withdrawal time-travel Signed-off-by: limepotato --- packages/backend/src/server/api/endpoints/notes/create.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/notes/create.ts b/packages/backend/src/server/api/endpoints/notes/create.ts index 9a6a5293b..511c1fd27 100644 --- a/packages/backend/src/server/api/endpoints/notes/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/create.ts @@ -150,6 +150,7 @@ export const paramDef = { }, required: ["choices"], }, + spoofCreatedAt: { type: "string", nullable: true }, }, anyOf: [ { @@ -282,9 +283,14 @@ export default define(meta, paramDef, async (ps, user) => { } } + let createdAt = new Date(); + if (ps.spoofCreatedAt) { + createdAt = new Date(ps.spoofCreatedAt); + } + // Create a post const note = await create(user, { - createdAt: new Date(), + createdAt, files: files, poll: ps.poll ? {