tamabahan

This commit is contained in:
bipproduction
2025-10-09 16:32:44 +08:00
parent 97c2508cf1
commit 8387cd28da

View File

@@ -60,7 +60,7 @@ const DarmasabaRoute = new Elysia({
detail: { detail: {
summary: "ls", summary: "ls",
description: "get list of dir in darmasaba", description: "get list of dir in darmasaba",
}, },
}) })
.get("/ls/:dir", async ({ params }) => { .get("/ls/:dir", async ({ params }) => {
@@ -129,7 +129,7 @@ const DarmasabaRoute = new Elysia({
} }
}) })
.get("/list-pengetahuan-umum", async () => { .get("/list-pengetahuan-umum", async () => {
const res = await fetch(url + `/repos/${REPO_ID}/dir/?p=${encodeURIComponent('darmasaba/pengetahuan-umum')}`, { const res = await fetch(url + `/repos/${REPO_ID}/dir/?p=${encodeURIComponent('darmasaba/pengetahuan-umum')}`, {
headers: { headers: {
Authorization: "Bearer " + TOKEN Authorization: "Bearer " + TOKEN
@@ -150,7 +150,7 @@ const DarmasabaRoute = new Elysia({
type: v.type type: v.type
} }
}) })
},{ }, {
detail: { detail: {
summary: "list-pengetahuan-umum", summary: "list-pengetahuan-umum",
description: "get list of files in darmasaba/pengetahuan-umum" description: "get list of files in darmasaba/pengetahuan-umum"
@@ -189,6 +189,29 @@ const DarmasabaRoute = new Elysia({
description: "get content of file in darmasaba/pengetahuan-umum/<file_name>" description: "get content of file in darmasaba/pengetahuan-umum/<file_name>"
} }
}) })
.post("/buat-laporan", ({ body }) => {
const { jenis_laporan, name, phone, detail } = body
return `
${JSON.stringify(body)}
laporan sudah diterima dan akan segera di tindak lanjuti`
}, {
body: t.Object({
jenis_laporan: t.String(),
name: t.String(),
phone: t.String(),
detail: t.String()
}),
detail: {
summary: "buat-laporan atau pengaduan",
description: `
tool untuk membuat laporan atau pengaduan warga kepada desa darmasaba
`
}
})
export default DarmasabaRoute export default DarmasabaRoute