:  api tambah pengaduan
This commit is contained in:
2025-12-08 14:10:34 +08:00
parent c256f4b729
commit d69189cf7d

View File

@@ -109,8 +109,8 @@ const PengaduanRoute = new Elysia({
// --- PENGADUAN ---
.post("/create", async ({ body, headers }) => {
const { judulPengaduan, detailPengaduan, lokasi, namaGambar, kategoriId } = body
const namaWarga = headers["x-user"] || ""
const noTelepon = headers["x-phone"] || ""
const namaWarga = headers['x-user'] || ""
const noTelepon = headers['x-phone'] || ""
let imageFix = namaGambar
const noPengaduan = await generateNoPengaduan()
let idCategoryFix = kategoriId
@@ -142,7 +142,7 @@ const PengaduanRoute = new Elysia({
}
if (!isValidPhone(noTelepon)) {
return { success: false, message: 'nomor telepon tidak valid, harap masukkan nomor yang benar' }
return { success: false, message: `nomor telepon ${noTelepon} tidak valid, harap masukkan nomor yang benar` }
}
const nomorHP = normalizePhoneNumber({ phone: noTelepon })