ucharles / gachatory

https://www.gachatory.com
0 stars 0 forks source link

fix: 프런트에서 전달받는 `_id` 값 검증하기 #120

Open ucharles opened 4 months ago

ucharles commented 4 months ago

예제

const tagId = params.tagId;

if (!tagId) { return NextResponse.json( { message: "tagId is required", }, { status: 400 }, ); }

if (ObjectId.isValid(tagId) === false) { return NextResponse.json( { message: "Invalid tagId", }, { status: 400 }, ); }