upd: api pengaduan
Deskripsi: - update seeder kategori pengaduan - list pengaduan warga NO Issues
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user