Correct to throw error if not a music file
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
042a6ae021
commit
fbcd7049bf
@ -8,7 +8,7 @@ const MUSIC_DIR = '/app/music';
|
|||||||
export async function POST(req: NextRequest) {
|
export async function POST(req: NextRequest) {
|
||||||
const formData = await req.formData();
|
const formData = await req.formData();
|
||||||
const file = formData.get('file') as File;
|
const file = formData.get('file') as File;
|
||||||
if (checkIfMusicFile(file.name)) {
|
if (!checkIfMusicFile(file.name)) {
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
{ error: 'Only music files are allowed to be uploaded' },
|
{ error: 'Only music files are allowed to be uploaded' },
|
||||||
{ status: 400 },
|
{ status: 400 },
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user