19 lines
522 B
JavaScript
19 lines
522 B
JavaScript
import { NextResponse } from "next/server";
|
|
import { submitContact } from "../../meshkee";
|
|
|
|
export async function POST(request) {
|
|
try {
|
|
const body = await request.json();
|
|
const data = await submitContact({
|
|
title: body.title,
|
|
name: body.name,
|
|
cellNumber: body.cellNumber,
|
|
email: body.email,
|
|
text: body.text
|
|
});
|
|
return NextResponse.json(data, { status: 201 });
|
|
} catch (error) {
|
|
return NextResponse.json({ message: "Contact submission failed" }, { status: 502 });
|
|
}
|
|
}
|