upd: api pengaduan

Deskripsi:
- update seeder kategori pengaduan
- list pengaduan warga

NO Issues
This commit is contained in:
2025-10-29 14:41:40 +08:00
parent b102643675
commit 06feeae9a5
2 changed files with 174 additions and 13 deletions

View File

@@ -1,5 +1,28 @@
import { prisma } from "@/server/lib/prisma";
const category = [
{
id: "lainnya",
name: "Lainnya"
},
{
id: "kebersihan",
name: "Kebersihan"
},
{
id: "keamanan",
name: "Keamanan"
},
{
id: "pelayanan",
name: "Pelayanan"
},
{
id: "infrastruktur",
name: "Infrastruktur"
},
]
const role = [
{
id: "developer",
@@ -36,7 +59,7 @@ const user = [
console.log(`✅ Role ${r.name} seeded successfully`)
}
for (const u of user) {
await prisma.user.upsert({
where: { email: u.email },
@@ -47,7 +70,17 @@ const user = [
console.log(`✅ User ${u.email} seeded successfully`)
}
for (const c of category) {
await prisma.categoryPengaduan.upsert({
where: { id: c.id },
create: c,
update: c
})
console.log(`✅ Category ${c.name} seeded successfully`)
}
})().catch((e) => {