fix: api
This commit is contained in:
@@ -42,7 +42,11 @@ async function sendMail(data: TFormData) {
|
||||
export async function POST(request: Request) {
|
||||
try {
|
||||
const payload = await request.json();
|
||||
if (payload.secure === process.env.SECURE_KEY) {
|
||||
console.log(payload);
|
||||
} else {
|
||||
throw new Error('Wrong secure key');
|
||||
}
|
||||
} catch (error) {
|
||||
return new Response(`Api error: ${error}`, {
|
||||
status: 400,
|
||||
|
||||
Reference in New Issue
Block a user