Currently, I am working on a project using Next.js with TypeScript. In this project, there is a form that users can fill out, and upon submitting the form, their data is sent to my Azure SQL database. To integrate my code with the database, I'm utilizing Prisma ORM. I have already initialized Prisma and created an API route for handling incoming requests.
The API route code snippet looks like this:
import { PrismaClient } from "@prisma/client";
import { NextApiRequest, NextApiResponse } from "next";
import { z } from "zod";
// Remaining code snippet follows...
However, when testing the functionality using Postman, I keep receiving a 500 Internal Server Error response.
In addition, here is a segment of the form Component in my application:
import AnotherButton from "@/components/buttons/AnotherButton"
import PrimaryButton from "@/components/buttons/PrimaryButton"
import axios from "axios"
// Remaining code snippet follows...
export default function GymOwners() {
const style = {
"border": "1px solid black"
}
// Previous state and handlers defined...
For your information, I am using Next.js with TypeScript version 14.