upd: api mobile

Deskripsi:
- upload gambar pada tambah member
- upload gambar pada edit member

No Issues
This commit is contained in:
amel
2025-05-19 15:38:43 +08:00
parent 9b2cb5baa5
commit d690e9c649

View File

@@ -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 == "") {