aduan sampah list
This commit is contained in:
13
src/pages/list/list_pengaduan_sampah.tsx
Normal file
13
src/pages/list/list_pengaduan_sampah.tsx
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import apiFetch from "@/lib/apiFetch"
|
||||||
|
import useSWR from "swr"
|
||||||
|
|
||||||
|
export default function ListPengaduanSampah() {
|
||||||
|
// const { data, error, isLoading, mutate } = useSWR("/", apiFetch.api.aduan["list-aduan-sampah"].get)
|
||||||
|
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<h1>List Pengaduan Sampah</h1>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -43,5 +43,17 @@ const AduanRoute = new Elysia({
|
|||||||
description: "tool untuk membuat aduan sampah liar",
|
description: "tool untuk membuat aduan sampah liar",
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
.get("/list-aduan-sampah", async () => {
|
||||||
|
const data = await prisma.pengaduanSampah.findMany()
|
||||||
|
return {
|
||||||
|
success: true,
|
||||||
|
data: data
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
detail: {
|
||||||
|
summary: "list aduan sampah",
|
||||||
|
description: "tool untuk melihat list aduan sampah liar",
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
export default AduanRoute
|
export default AduanRoute
|
||||||
|
|||||||
Reference in New Issue
Block a user