feat : filter api

This commit is contained in:
lukman
2024-08-06 17:43:40 +08:00
parent 1be70b3fc7
commit 549dadfba1
15 changed files with 102 additions and 88 deletions

View File

@@ -7,11 +7,11 @@ export async function getAllUser(req: NextRequest) {
try {
let fixGroup
const searchParams = req.nextUrl.searchParams;
const idGroup = searchParams.get("groupID");
const idGroup = searchParams.get("groupId");
const active = searchParams.get("active");
const user = await funGetUserByCookies();
if (idGroup == null || idGroup == undefined) {
if (idGroup == "null" || idGroup == undefined) {
fixGroup = user.idGroup
} else {
fixGroup = idGroup

View File

@@ -19,6 +19,7 @@ export async function getOneUser(req: NextRequest) {
email: true,
gender: true,
idGroup: true,
isActive: true,
idPosition: true,
UserRole: {
select: {