tambahan
This commit is contained in:
@@ -31,7 +31,7 @@ const TestPengaduanRoute = new Elysia({
|
|||||||
})
|
})
|
||||||
|
|
||||||
.post("/create", async ({ body }) => {
|
.post("/create", async ({ body }) => {
|
||||||
const { judulPengaduan, detailPengaduan, lokasi, kategoriId, noTelepon } = body
|
const { judulPengaduan, detailPengaduan, lokasi, kategoriId, noTelepon, image } = body
|
||||||
const noPengaduan = await generateNoPengaduan()
|
const noPengaduan = await generateNoPengaduan()
|
||||||
let idCategoryFix = kategoriId
|
let idCategoryFix = kategoriId
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ const TestPengaduanRoute = new Elysia({
|
|||||||
idCategory: idCategoryFix,
|
idCategory: idCategoryFix,
|
||||||
idWarga: cariWarga.id,
|
idWarga: cariWarga.id,
|
||||||
location: lokasi,
|
location: lokasi,
|
||||||
image: "",
|
image: body.image || "",
|
||||||
noPengaduan,
|
noPengaduan,
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
@@ -108,18 +108,11 @@ const TestPengaduanRoute = new Elysia({
|
|||||||
}, {
|
}, {
|
||||||
body: t.Object({
|
body: t.Object({
|
||||||
judulPengaduan: t.String(),
|
judulPengaduan: t.String(),
|
||||||
|
|
||||||
detailPengaduan: t.String(),
|
detailPengaduan: t.String(),
|
||||||
|
|
||||||
lokasi: t.String(),
|
lokasi: t.String(),
|
||||||
|
|
||||||
kategoriId: t.String(),
|
kategoriId: t.String(),
|
||||||
|
noTelepon: t.String(),
|
||||||
noTelepon: t.String({
|
image: t.Optional(t.String()),
|
||||||
error: "Nomor telepon harus diisi",
|
|
||||||
examples: ["08123456789", "+628123456789"],
|
|
||||||
description: "Nomor telepon warga pelapor"
|
|
||||||
}),
|
|
||||||
}),
|
}),
|
||||||
|
|
||||||
detail: {
|
detail: {
|
||||||
|
|||||||
Reference in New Issue
Block a user