upd: api jenna ai
Deskripsi: - create pengaduan pake nama dan nomer hp dari header No Issues
This commit is contained in:
@@ -107,8 +107,10 @@ const PengaduanRoute = new Elysia({
|
|||||||
|
|
||||||
|
|
||||||
// --- PENGADUAN ---
|
// --- PENGADUAN ---
|
||||||
.post("/create", async ({ body }) => {
|
.post("/create", async ({ body, headers }) => {
|
||||||
const { judulPengaduan, detailPengaduan, lokasi, namaGambar, kategoriId, namaWarga, noTelepon } = body
|
const { judulPengaduan, detailPengaduan, lokasi, namaGambar, kategoriId } = body
|
||||||
|
const namaWarga = headers["x-user"] || ""
|
||||||
|
const noTelepon = headers["x-phone"] || ""
|
||||||
let imageFix = namaGambar
|
let imageFix = namaGambar
|
||||||
const noPengaduan = await generateNoPengaduan()
|
const noPengaduan = await generateNoPengaduan()
|
||||||
let idCategoryFix = kategoriId
|
let idCategoryFix = kategoriId
|
||||||
@@ -220,16 +222,16 @@ const PengaduanRoute = new Elysia({
|
|||||||
description: "ID atau nama kategori pengaduan (contoh: kebersihan, keamanan, lainnya)"
|
description: "ID atau nama kategori pengaduan (contoh: kebersihan, keamanan, lainnya)"
|
||||||
})),
|
})),
|
||||||
|
|
||||||
namaWarga: t.String({
|
// namaWarga: t.String({
|
||||||
examples: ["budiman"],
|
// examples: ["budiman"],
|
||||||
description: "Nama warga yang melapor"
|
// description: "Nama warga yang melapor"
|
||||||
}),
|
// }),
|
||||||
|
|
||||||
noTelepon: t.String({
|
// noTelepon: t.String({
|
||||||
error: "Nomor telepon harus diisi",
|
// error: "Nomor telepon harus diisi",
|
||||||
examples: ["08123456789", "+628123456789"],
|
// examples: ["08123456789", "+628123456789"],
|
||||||
description: "Nomor telepon warga pelapor"
|
// description: "Nomor telepon warga pelapor"
|
||||||
}),
|
// }),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
detail: {
|
detail: {
|
||||||
|
|||||||
Reference in New Issue
Block a user