refactor: use NextResponse

This commit is contained in:
Riccardo
2024-06-18 12:22:53 +02:00
parent e0b89237fb
commit c75d5b6936
5 changed files with 10 additions and 5 deletions

View File

@@ -8,11 +8,12 @@ import {
STATUS_OK
} from '@utils/statusCodes';
import { ConfirmationSchema, ResponseType } from '@utils/validationSchemas';
import { NextRequest } from 'next/server';
import { Resend } from 'resend';
export const dynamic = 'force-dynamic'; // defaults to force-static
export async function POST(request: Request) {
export async function POST(request: NextRequest) {
try {
if (!process.env.RESEND_KEY || !process.env.RESEND_AUDIENCE) {
throw new Error('RESEND_AUDIENCE is not set');