-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update api #113
Update api #113
Conversation
This pull request updates the seeLists.ts from main to the new schema. |
@ThoJah please finish PRs before asking instructors to merge, are you finished? If so turn this draft PR to a PR |
Includes the toplevel initialization of prisma |
src/pages/api/prisma.tsx
Outdated
@@ -0,0 +1,11 @@ | |||
import { PrismaClient } from "@prisma/client"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change file to .ts as there is no html in this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
applied
src/pages/api/deleteList.ts
Outdated
@@ -1,6 +1,6 @@ | |||
import { NextApiRequest, NextApiResponse } from "next"; | |||
import { z, ZodError } from "zod"; | |||
import { Items, List, Prisma, PrismaClient } from "@prisma/client"; | |||
import { PrismaClient } from "@prisma/client"; | |||
|
|||
const prisma = new PrismaClient(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to import the exported prisma client in the prisma.ts file, and not instantiate a new prisma client here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
applied
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.