Send 204 status

This commit is contained in:
TomatoCake
2024-08-15 10:14:44 +02:00
parent 35dde2e6e9
commit 475aee372b
4 changed files with 22 additions and 14 deletions
@@ -155,12 +155,20 @@ router.get(
} else {
if (after) {
if (BigInt(after) > BigInt(Snowflake.generate()))
return res.status(422);
throw new HTTPError(
"after parameter must not be greater than current time",
422,
);
query.where.id = MoreThan(after);
query.order = { timestamp: "ASC" };
} else if (before) {
if (BigInt(before) > BigInt(Snowflake.generate()))
return res.status(422);
throw new HTTPError(
"before parameter must not be greater than current time",
422,
);
query.where.id = LessThan(before);
}