fix: api
Deskripsi: - update api yang pake filter idgrup, ketika idgrup='' No Issues
This commit is contained in:
@@ -23,7 +23,7 @@ export async function GET(request: Request) {
|
||||
const active = searchParams.get("active");
|
||||
const dataSkip = Number(page) * 10 - 10;
|
||||
|
||||
if (idGroup == "null" || idGroup == undefined) {
|
||||
if (idGroup == "null" || idGroup == undefined || idGroup == "") {
|
||||
grup = user.idGroup
|
||||
} else {
|
||||
grup = idGroup
|
||||
|
||||
@@ -19,7 +19,7 @@ export async function GET(request: Request) {
|
||||
return NextResponse.json({ success: false, message: "Anda harus login untuk mengakses ini" }, { status: 401 });
|
||||
}
|
||||
|
||||
if (idGroup == "null" || idGroup == undefined) {
|
||||
if (idGroup == "null" || idGroup == undefined || idGroup == "") {
|
||||
grup = user.idGroup
|
||||
} else {
|
||||
grup = idGroup
|
||||
|
||||
@@ -24,7 +24,7 @@ export async function GET(request: Request) {
|
||||
const villageId = user.idVillage
|
||||
const userId = user.id
|
||||
|
||||
if (idGroup == "null" || idGroup == undefined) {
|
||||
if (idGroup == "null" || idGroup == undefined || idGroup == "") {
|
||||
grup = user.idGroup
|
||||
} else {
|
||||
grup = idGroup
|
||||
|
||||
Reference in New Issue
Block a user