feat : add api

This commit is contained in:
lukman
2024-07-25 10:07:26 +08:00
parent c2a050a03d
commit 6872fb51b2
4 changed files with 46 additions and 4 deletions

View File

@@ -1,11 +1,12 @@
import prisma from "@/module/_global/bin/prisma";
import { Login } from "@/types/auth/login";
import { prisma } from "@/module/_global";
import { ILogin } from "@/types";
import { NextRequest } from "next/server";
export async function POST(req: NextRequest) {
const { email }: Login = await req.json();
const { phone }: ILogin = await req.json();
const user = await prisma.user.findUnique({
where: { email, isActive: true },
where: { phone, isActive: true },
select: { id: true, phone: true },
});