upd: apaa aja aku lupa

This commit is contained in:
amel
2024-08-02 14:54:59 +08:00
parent 6a94bcc696
commit 96fc88efba
17 changed files with 196 additions and 107 deletions

View File

@@ -1,11 +1,12 @@
import { prisma } from "@/module/_global";
import { funGetUserByCookies } from "@/module/auth";
import { NextRequest } from "next/server";
export async function listGroups(req: NextRequest): Promise<Response> {
try {
const user = await funGetUserByCookies()
const searchParams = req.nextUrl.searchParams
const villaId = "121212"
const villaId = user.idVillage
const active = searchParams.get('active');
const groups = await prisma.group.findMany({
where: {

View File

@@ -1,5 +1,7 @@
import { TypeGroup } from './lib/type_group';
import { apiGroup } from "./api/api_group";
import ViewGroup from "./view/view_group";
export { ViewGroup };
export { apiGroup };
export type { TypeGroup }

View File

@@ -0,0 +1,5 @@
export type TypeGroup = {
id: string
name: string
isActive: boolean
}[]