This commit is contained in:
MeowcaTheoRange 2024-04-24 21:01:14 -05:00
parent 073f8d9e80
commit 7ac246157b
6 changed files with 12 additions and 12 deletions

View file

@ -116,7 +116,7 @@ export async function PATCH(request: NextRequest, {params}: {params: {content:st
let newBody:Partial<JudgementTable> = {}; let newBody:Partial<JudgementTable> = {};
if (body.content != null && typeof body.content === 'string') newBody.content = body.content; if (body.content != null && typeof body.content === 'string' && body.content.length <= 10000) newBody.content = body.content;
let res; let res;
try { try {

View file

@ -95,7 +95,7 @@ export async function POST(request: NextRequest, {params}: {params: {content: st
if (body.id != null) te.push("id"); if (body.id != null) te.push("id");
if (body.author_id != null) te.push("author_id"); if (body.author_id != null) te.push("author_id");
if (body.content_id != null) te.push("content_id"); if (body.content_id != null) te.push("content_id");
if (typeof body.content !== 'string') te.push("content"); if (typeof body.content !== 'string' && body.description.length <= 10000) te.push("content");
if (body.published != null) te.push("published"); if (body.published != null) te.push("published");

View file

@ -86,9 +86,9 @@ export async function PATCH(request: NextRequest, {params}: {params: {content:st
let newBody:Partial<ContentTable> = {}; let newBody:Partial<ContentTable> = {};
if (body.name != null && typeof body.name === 'string') newBody.name = body.name; if (body.name != null && typeof body.name === 'string' && body.name.length <= 2048) newBody.name = body.name;
if (body.description != null && typeof body.description === 'string') newBody.description = body.description; if (body.description != null && typeof body.description === 'string' && body.description.length <= 10000) newBody.description = body.description;
if (body.url != null && typeof body.url === 'string') newBody.url = body.url; if (body.url != null && typeof body.url === 'string' && body.url.length <= 2048) newBody.url = body.url;
let res; let res;
try { try {

View file

@ -100,9 +100,9 @@ export async function POST(request: NextRequest, {params}: {params: {jam: string
if (body.id != null) te.push("id"); if (body.id != null) te.push("id");
if (body.author_id != null) te.push("author_id"); if (body.author_id != null) te.push("author_id");
if (body.jam_id != null) te.push("jam_id"); if (body.jam_id != null) te.push("jam_id");
if (typeof body.name !== 'string') te.push("name"); if (typeof body.name !== 'string' && body.name.length <= 2048) te.push("name");
if (typeof body.description !== 'string') te.push("description"); if (typeof body.description !== 'string' && body.description.length <= 10000) te.push("description");
if (typeof body.url !== 'string') te.push("url"); if (typeof body.url !== 'string' && body.url.length <= 2048) te.push("url");
if (body.submitted != null) te.push("submitted"); if (body.submitted != null) te.push("submitted");

View file

@ -86,8 +86,8 @@ export async function PATCH(request: NextRequest, {params}: {params: {jam:string
let newBody:Partial<JamTable> = {}; let newBody:Partial<JamTable> = {};
if (body.name != null && typeof body.name === 'string') newBody.name = body.name; if (body.name != null && typeof body.name === 'string' && body.name.length <= 2048) newBody.name = body.name;
if (body.description != null && typeof body.description === 'string') newBody.description = body.description; if (body.description != null && typeof body.description === 'string' && body.description.length <= 10000) newBody.description = body.description;
if (body.date_start != null && typeof body.date_start === 'number') newBody.date_start = body.date_start; if (body.date_start != null && typeof body.date_start === 'number') newBody.date_start = body.date_start;
if (body.date_end != null && typeof body.date_end === 'number') newBody.date_end = body.date_end; if (body.date_end != null && typeof body.date_end === 'number') newBody.date_end = body.date_end;

View file

@ -69,8 +69,8 @@ export async function POST(request: NextRequest) {
const te = []; const te = [];
if (body.id != null) te.push("id"); if (body.id != null) te.push("id");
if (body.author_id != null) te.push("author_id"); if (body.author_id != null) te.push("author_id");
if (typeof body.name !== 'string') te.push("name"); if (typeof body.name !== 'string' && body.name.length <= 2048) te.push("name");
if (typeof body.description !== 'string') te.push("description"); if (typeof body.description !== 'string' && body.description.length <= 10000) te.push("description");
if (typeof body.date_start !== 'number') te.push("date_start"); if (typeof body.date_start !== 'number') te.push("date_start");
if (typeof body.date_end !== 'number') te.push("date_end"); if (typeof body.date_end !== 'number') te.push("date_end");
if (body.created != null) te.push("created"); if (body.created != null) te.push("created");