deskripsi:
- api login , validasi, hapus code otp
This commit is contained in:
2025-02-05 10:35:33 +08:00
parent 46d49992b4
commit 7c04d85134
18 changed files with 442 additions and 300 deletions

View File

@@ -0,0 +1,30 @@
import { prisma } from "@/app/lib";
import backendLogger from "@/util/backendLogger";
import { NextRequest, NextResponse } from "next/server";
export const dynamic = "force-dynamic";
export async function GET(
request: Request,
{ params }: { params: { id: string } }
) {
if (request.method !== "GET") {
return NextResponse.json(
{ success: false, message: "Method not allowed" },
{ status: 405 }
);
}
try {
const { id } = params;
const data = await prisma.kodeOtp.findFirst({
where: {
id: id as string,
},
});
return NextResponse.json(data, { status: 200 });
} catch (error) {
backendLogger.error("Error get code otp", error); //(error);
return NextResponse.json(null, { status: 500 });
}
}