This repository has been archived on 2026-01-31. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
nextjs-auth0/app/api/register/route.ts
2024-06-26 12:48:45 +02:00

27 lines
540 B
TypeScript

import prisma from '@prisma/prisma';
import { NextRequest, NextResponse } from 'next/server';
export async function POST(request: NextRequest) {
const body = await request.json();
console.log('request', request, 'body', body);
const { email } = await request.json();
if (email) {
await prisma.user.upsert({
create: {
email
},
update: {
updatedAt: new Date()
},
where: {
deleted: false,
email
}
});
}
return NextResponse.json({ message: email });
}