diff --git a/src/server/routes/test_pengaduan.ts b/src/server/routes/test_pengaduan.ts index 32a9adb..b15dc3e 100644 --- a/src/server/routes/test_pengaduan.ts +++ b/src/server/routes/test_pengaduan.ts @@ -31,7 +31,7 @@ const TestPengaduanRoute = new Elysia({ }) .post("/create", async ({ body }) => { - const { judulPengaduan, detailPengaduan, lokasi, kategoriId, noTelepon } = body + const { judulPengaduan, detailPengaduan, lokasi, kategoriId, noTelepon, image } = body const noPengaduan = await generateNoPengaduan() let idCategoryFix = kategoriId @@ -85,7 +85,7 @@ const TestPengaduanRoute = new Elysia({ idCategory: idCategoryFix, idWarga: cariWarga.id, location: lokasi, - image: "", + image: body.image || "", noPengaduan, }, select: { @@ -108,18 +108,11 @@ const TestPengaduanRoute = new Elysia({ }, { body: t.Object({ judulPengaduan: t.String(), - detailPengaduan: t.String(), - lokasi: t.String(), - kategoriId: t.String(), - - noTelepon: t.String({ - error: "Nomor telepon harus diisi", - examples: ["08123456789", "+628123456789"], - description: "Nomor telepon warga pelapor" - }), + noTelepon: t.String(), + image: t.Optional(t.String()), }), detail: {