recipients ui and api basics

This commit is contained in:
Timur Ercan
2023-02-03 18:39:17 +01:00
parent e9db5acc85
commit b854600fb3
5 changed files with 59 additions and 2 deletions

View File

@ -32,9 +32,10 @@ async function postHandler(req: NextApiRequest, res: NextApiResponse) {
return res.status(401).send("User does not have access to this document.");
}
const upsert = await prisma.recipient.upsert({
await prisma.recipient.upsert({
where: {
email: body.email,
// todo id
},
update: {
email: body.email,