Merge pull request #165 from bipproduction/lukman/29-agustus-2024

Lukman/29 agustus 2024
This commit is contained in:
Amalia
2024-08-29 15:53:58 +08:00
committed by GitHub
17 changed files with 501 additions and 175 deletions

View File

@@ -16,18 +16,25 @@ export async function GET(request: Request) {
const { searchParams } = new URL(request.url);
let grup
const name = searchParams.get('search');
const status = searchParams.get('status');
const idGroup = searchParams.get("group");
const villageId = user.idVillage
const groupId = user.idGroup
const userId = user.id
if (idGroup == "null" || idGroup == undefined) {
grup = user.idGroup
} else {
grup = idGroup
}
const data = await prisma.project.findMany({
where: {
isActive: true,
idVillage: String(villageId),
idGroup: String(groupId),
idGroup: grup,
createdBy: String(userId),
title: {
contains: (name == undefined || name == "null") ? "" : name,