chore: code cleaning (#21)
This commit is contained in:
7
utils/formatApiResponse.ts
Normal file
7
utils/formatApiResponse.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
|
||||
export function formatApiResponse(status: number, message: unknown) {
|
||||
const stringMessage = JSON.stringify(message);
|
||||
|
||||
return new NextResponse(stringMessage, { status });
|
||||
}
|
||||
Reference in New Issue
Block a user