upd: api mobile
Deskripsi: - upload gambar pada tambah member - upload gambar pada edit member No Issues
This commit is contained in:
@@ -151,14 +151,13 @@ export async function POST(request: Request) {
|
|||||||
const body = await request.formData()
|
const body = await request.formData()
|
||||||
const data = JSON.parse(body.get("data") as string)
|
const data = JSON.parse(body.get("data") as string)
|
||||||
const file = body.get("file") as File
|
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 });
|
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)
|
const village = String(user.idVillage)
|
||||||
|
|
||||||
let groupFix = data.idGroup
|
let groupFix = data.idGroup
|
||||||
|
|
||||||
if (groupFix == null || groupFix == undefined || groupFix == "") {
|
if (groupFix == null || groupFix == undefined || groupFix == "") {
|
||||||
|
|||||||
Reference in New Issue
Block a user