From 22971f460dde411a6704212743b0720283c26152 Mon Sep 17 00:00:00 2001 From: MeowcaTheoRange Date: Wed, 24 Apr 2024 21:06:16 -0500 Subject: [PATCH] fuckywucky --- src/app/jams/api/content/[content]/judgements/route.ts | 2 +- src/app/jams/api/jams/[jam]/content/route.ts | 6 +++--- src/app/jams/api/jams/route.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/jams/api/content/[content]/judgements/route.ts b/src/app/jams/api/content/[content]/judgements/route.ts index 181c0b3..c1b9310 100644 --- a/src/app/jams/api/content/[content]/judgements/route.ts +++ b/src/app/jams/api/content/[content]/judgements/route.ts @@ -95,7 +95,7 @@ export async function POST(request: NextRequest, {params}: {params: {content: st if (body.id != null) te.push("id"); if (body.author_id != null) te.push("author_id"); if (body.content_id != null) te.push("content_id"); - if (typeof body.content !== 'string' && body.description.length >= 10 && body.description.length <= 10000) te.push("content"); + if (typeof body.content !== 'string' || body.description.length < 10 || body.description.length > 10000) te.push("content"); if (body.published != null) te.push("published"); diff --git a/src/app/jams/api/jams/[jam]/content/route.ts b/src/app/jams/api/jams/[jam]/content/route.ts index 295f8fa..fa07152 100644 --- a/src/app/jams/api/jams/[jam]/content/route.ts +++ b/src/app/jams/api/jams/[jam]/content/route.ts @@ -100,9 +100,9 @@ export async function POST(request: NextRequest, {params}: {params: {jam: string if (body.id != null) te.push("id"); if (body.author_id != null) te.push("author_id"); if (body.jam_id != null) te.push("jam_id"); - if (typeof body.name !== 'string' && body.name.length >= 10 && body.name.length <= 2048) te.push("name"); - if (typeof body.description !== 'string' && body.description.length >= 10 && body.description.length <= 10000) te.push("description"); - if (typeof body.url !== 'string' && body.url.length >= 3 && body.url.length <= 2048) te.push("url"); + if (typeof body.name !== 'string' || body.name.length < 10 || body.name.length > 2048) te.push("name"); + if (typeof body.description !== 'string' || body.description.length < 10 || body.description.length > 10000) te.push("description"); + if (typeof body.url !== 'string' || body.url.length < 3 || body.url.length > 2048) te.push("url"); if (body.submitted != null) te.push("submitted"); diff --git a/src/app/jams/api/jams/route.ts b/src/app/jams/api/jams/route.ts index 5a8bdfc..79f31bf 100644 --- a/src/app/jams/api/jams/route.ts +++ b/src/app/jams/api/jams/route.ts @@ -69,8 +69,8 @@ export async function POST(request: NextRequest) { const te = []; if (body.id != null) te.push("id"); if (body.author_id != null) te.push("author_id"); - if (typeof body.name !== 'string' && body.name.length >= 10 && body.name.length <= 2048) te.push("name"); - if (typeof body.description !== 'string' && body.description.length >= 10 && body.description.length <= 10000) te.push("description"); + if (typeof body.name !== 'string' || body.name.length < 10 || body.name.length > 2048) te.push("name"); + if (typeof body.description !== 'string' || body.description.length < 10 || body.description.length > 10000) te.push("description"); if (typeof body.date_start !== 'number') te.push("date_start"); if (typeof body.date_end !== 'number') te.push("date_end"); if (body.created != null) te.push("created");