feat : add group

This commit is contained in:
lukman
2024-07-30 15:07:41 +08:00
parent 459546dff4
commit a336728d0c
11 changed files with 378 additions and 243 deletions

View File

@@ -5,15 +5,17 @@ export async function listGroups(req: NextRequest): Promise<Response> {
try {
const searchParams = req.nextUrl.searchParams
const villaId = searchParams.get('villageId');
const villaId = "121212"
const active = searchParams.get('active');
const groups = await prisma.group.findMany({
where: {
isActive: true,
isActive: (active == "true" ? true : false),
idVillage: String(villaId),
},
select: {
id: true,
name: true,
isActive: true
},
});