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 getAllPosition(req: NextRequest) {
const searchParams = req.nextUrl.searchParams
const groupID = searchParams.get('groupId');
const active = searchParams.get('active');
const name = searchParams.get('name')
const user = await funGetUserByCookies()
console.log(groupID)
@@ -23,6 +24,10 @@ export async function getAllPosition(req: NextRequest) {
where: {
idGroup: String(grupFix),
isActive: (active == "true" ? true : false),
name: {
contains: String(name),
mode: "insensitive"
}
},
select: {
id: true,