feat : add group

This commit is contained in:
lukman
2024-08-02 14:59:21 +08:00
parent ad59566cdf
commit 31bc53ccf3
5 changed files with 15 additions and 4 deletions

View File

@@ -5,7 +5,7 @@ export async function listGroups(req: NextRequest): Promise<Response> {
try {
const searchParams = req.nextUrl.searchParams
const villaId = "121212"
const villaId = "desa1"
const active = searchParams.get('active');
const groups = await prisma.group.findMany({
where: {

View File

@@ -4,7 +4,7 @@ import { revalidatePath } from "next/cache";
export async function createGroup(req: Request) {
try {
const data = await req.json();
const villaId = "121212";
const villaId = "desa1";
if (!data || !data.name) {
return Response.json(