feat: tambah field isApprover pada endpoint get & edit user
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user