feat : update search

Deskripsi:
- search group
- search position
- search member / user / anggota

No Issue
This commit is contained in:
lukman
2024-08-07 10:37:04 +08:00
parent b2ecfe4f4b
commit ad94d0aaa0
7 changed files with 67 additions and 45 deletions

View File

@@ -10,6 +10,7 @@ export async function getAllUser(req: NextRequest) {
const idGroup = searchParams.get("groupId");
const active = searchParams.get("active");
const user = await funGetUserByCookies();
const name = searchParams.get("name")
if (idGroup == "null" || idGroup == undefined) {
fixGroup = user.idGroup
@@ -21,6 +22,10 @@ export async function getAllUser(req: NextRequest) {
where: {
isActive: active == "true" ? true : false,
idGroup: String(fixGroup),
name: {
contains: String(name),
mode: "insensitive",
}
},
select: {
id: true,