diff --git a/package.json b/package.json index 2425e92..66d8393 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sistem-desa-mandiri", - "version": "0.1.10", + "version": "0.1.11", "private": true, "scripts": { "dev": "next dev --experimental-https", diff --git a/prisma/migrations/20260512091824_auto/migration.sql b/prisma/migrations/20260512091824_auto/migration.sql new file mode 100644 index 0000000..af5102c --- /dev/null +++ b/prisma/migrations/20260512091824_auto/migration.sql @@ -0,0 +1 @@ +-- This is an empty migration. \ No newline at end of file diff --git a/src/app/api/monitoring/[[...slug]]/route.ts b/src/app/api/monitoring/[[...slug]]/route.ts index f3ebf0b..c892c36 100644 --- a/src/app/api/monitoring/[[...slug]]/route.ts +++ b/src/app/api/monitoring/[[...slug]]/route.ts @@ -311,13 +311,13 @@ const MonitoringServer = new Elysia({ prefix: "/api/monitoring" }) try { const data = await prisma.village.findMany({ where: { - isDummy: false, ...(search && { name: { contains: search, mode: 'insensitive' } }) }, select: { id: true, name: true, isActive: true, + isDummy: true, createdAt: true, User: { where: { @@ -335,7 +335,6 @@ const MonitoringServer = new Elysia({ prefix: "/api/monitoring" }) const count = await prisma.village.count({ where: { - isDummy: false, ...(search && { name: { contains: search, mode: 'insensitive' } }) }, }) @@ -344,6 +343,7 @@ const MonitoringServer = new Elysia({ prefix: "/api/monitoring" }) id: village.id, name: village.name, isActive: village.isActive, + isDummy: village.isDummy, createdAt: formatDateTime(village.createdAt), perbekel: village.User[0]?.name || null, })); @@ -501,6 +501,7 @@ const MonitoringServer = new Elysia({ prefix: "/api/monitoring" }) id: true, name: true, isActive: true, + isDummy: true, createdAt: true, updatedAt: true, desc: true, @@ -529,6 +530,7 @@ const MonitoringServer = new Elysia({ prefix: "/api/monitoring" }) id: data?.id, name: data?.name, isActive: data?.isActive, + isDummy: data?.isDummy, desc: data?.desc, createdAt: data?.createdAt ? formatDateTime(data.createdAt) : null, updatedAt: data?.updatedAt ? formatDateTime(data.updatedAt) : null, @@ -957,7 +959,7 @@ const MonitoringServer = new Elysia({ prefix: "/api/monitoring" }) } ) .post("/edit-villages", async ({ body, set }) => { - const { id, name, desc } = body; + const { id, name, desc, isDummy } = body; try { const village = await prisma.village.findUnique({ @@ -977,6 +979,7 @@ const MonitoringServer = new Elysia({ prefix: "/api/monitoring" }) data: { name, desc, + isDummy, }, }); @@ -998,6 +1001,7 @@ const MonitoringServer = new Elysia({ prefix: "/api/monitoring" }) id: t.String({ description: "ID desa" }), name: t.String({ description: "Nama desa" }), desc: t.String({ description: "Deskripsi desa" }), + isDummy: t.Boolean({ description: "Apakah desa dummy" }), }), detail: { summary: "Edit Villages",