refactor: improve news and email handling, style, folder structure (#16)
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
|
||||
export function ApiResponse(status: number, message: string) {
|
||||
const response = new NextResponse(message, { status });
|
||||
response.headers.set('Access-Control-Allow-Origin', process.env.HOME_URL!);
|
||||
export function ApiResponse(status: number, message: unknown) {
|
||||
const stringMessage = JSON.stringify(message);
|
||||
|
||||
return response;
|
||||
return new NextResponse(stringMessage, { status });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user