diff --git a/src/app/api/mobile/user/route.ts b/src/app/api/mobile/user/route.ts index 1776b51..1729227 100644 --- a/src/app/api/mobile/user/route.ts +++ b/src/app/api/mobile/user/route.ts @@ -151,14 +151,13 @@ export async function POST(request: Request) { const body = await request.formData() const data = JSON.parse(body.get("data") as string) const file = body.get("file") as File + const user = await funGetUserById({ id: data.user }) - if (data.user == "null" || data.user == undefined || data.user == "") { + if (user.id == "null" || user.id == undefined || user.id == "") { return NextResponse.json({ success: false, message: "Anda harus login untuk mengakses ini" }, { status: 200 }); } - const user = await funGetUserById({ id: data.user }) const village = String(user.idVillage) - let groupFix = data.idGroup if (groupFix == null || groupFix == undefined || groupFix == "") {