API Mobile

Add:
- event
- user[id]
- mobile ( api baru untuk cek token )

Fix:
- portofolio/[id]
- mobile/user

### No Issue
This commit is contained in:
2025-09-10 17:47:48 +08:00
parent af7f4e0027
commit f337d45e5c
5 changed files with 292 additions and 14 deletions

View File

@@ -0,0 +1,34 @@
import { prisma } from "@/lib";
import { NextResponse } from "next/server";
export async function GET(
request: Request,
{ params }: { params: { id: string } }
) {
try {
const { id } = params;
const data = await prisma.user.findUnique({
where: {
id: id,
},
include: {
Profile: true,
},
});
return NextResponse.json(
{ success: true, message: "Berhasil mendapatkan data", data: data },
{ status: 200 }
);
} catch (error) {
return NextResponse.json(
{
success: false,
message: "Error get data from API ",
reason: (error as Error).message,
},
{ status: 500 }
);
}
}