From 17004cc835a432791029db383a6dbc130195881e Mon Sep 17 00:00:00 2001 From: bipproduction Date: Mon, 20 Oct 2025 14:26:08 +0800 Subject: [PATCH] aduan sampah list --- src/pages/list/list_pengaduan_sampah.tsx | 13 +++++++++++++ src/server/routes/aduan_route.ts | 12 ++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 src/pages/list/list_pengaduan_sampah.tsx diff --git a/src/pages/list/list_pengaduan_sampah.tsx b/src/pages/list/list_pengaduan_sampah.tsx new file mode 100644 index 0000000..e1fc389 --- /dev/null +++ b/src/pages/list/list_pengaduan_sampah.tsx @@ -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 ( +
+

List Pengaduan Sampah

+
+ ) +} \ No newline at end of file diff --git a/src/server/routes/aduan_route.ts b/src/server/routes/aduan_route.ts index 404d6b3..a9d6d32 100644 --- a/src/server/routes/aduan_route.ts +++ b/src/server/routes/aduan_route.ts @@ -43,5 +43,17 @@ const AduanRoute = new Elysia({ 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