From 8240d608ad5611083a9525214673f7c6596ed518 Mon Sep 17 00:00:00 2001 From: amaliadwiy Date: Mon, 18 May 2026 16:42:33 +0800 Subject: [PATCH] feat: tambah field isApprover pada endpoint get & edit user --- src/app/api/monitoring/[[...slug]]/route.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/api/monitoring/[[...slug]]/route.ts b/src/app/api/monitoring/[[...slug]]/route.ts index 33dca7a..d606510 100644 --- a/src/app/api/monitoring/[[...slug]]/route.ts +++ b/src/app/api/monitoring/[[...slug]]/route.ts @@ -1242,6 +1242,7 @@ const MonitoringServer = new Elysia({ prefix: "/api/monitoring" }) email: true, isWithoutOTP: true, isActive: true, + isApprover: true, idUserRole: true, idVillage: true, idGroup: true, @@ -1328,6 +1329,7 @@ const MonitoringServer = new Elysia({ prefix: "/api/monitoring" }) gender: item.gender, isWithoutOTP: item.isWithoutOTP, isActive: item.isActive, + isApprover: item.isApprover, role: item.UserRole?.name, village: item.Village?.name, group: item.Group?.name, @@ -1440,7 +1442,7 @@ const MonitoringServer = new Elysia({ prefix: "/api/monitoring" }) } ) .post("/edit-user", async ({ body, set }) => { - const { id, name, nik, phone, email, gender, idUserRole, idVillage, idGroup, idPosition, isActive, isWithoutOTP } = body; + const { id, name, nik, phone, email, gender, idUserRole, idVillage, idGroup, idPosition, isActive, isWithoutOTP, isApprover } = body; try { const cekId = await prisma.user.findFirst({ @@ -1492,6 +1494,7 @@ const MonitoringServer = new Elysia({ prefix: "/api/monitoring" }) idPosition, isActive, isWithoutOTP, + isApprover, }, }); @@ -1522,6 +1525,7 @@ const MonitoringServer = new Elysia({ prefix: "/api/monitoring" }) idPosition: t.Optional(t.Union([t.String(), t.Null()], { description: "ID Posisi" })), isActive: t.Boolean({ description: "Aktif" }), isWithoutOTP: t.Boolean({ description: "Tanpa OTP" }), + isApprover: t.Boolean({ description: "Approver" }), }), detail: { summary: "Edit User",