feat : add group
This commit is contained in:
2
api.http
2
api.http
@@ -118,7 +118,7 @@ Content-Type: application/json
|
||||
// USERS
|
||||
|
||||
###
|
||||
GET http://localhost:3000/api/user/get?path=get-all-users&roleID=dev&villageID=121212&groupID=2&positionID=clz24bff70001w01in64dd9ea HTTP/1.1
|
||||
GET http://localhost:3000/api/user/get?path=get-all-users&active=true HTTP/1.1
|
||||
|
||||
###
|
||||
GET http://localhost:3000/api/user/get?path=get-one-users&userID=devAmalia HTTP/1.1
|
||||
|
||||
@@ -12,6 +12,7 @@ export const API_ADDRESS = {
|
||||
"apiCreateUser": "/api/user/post?path=create-users",
|
||||
"apiUpdateUser": "/api/user/post?path=update-users",
|
||||
"apiDeleteUser": "/api/user/post?path=delete-users",
|
||||
"apiGetRoleUser": "/api/user/get?path=get-role-user",
|
||||
|
||||
// Announcement
|
||||
"apiGetAllAnnouncement": "/api/announcement/get?path=get-all-announcement",
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -1,12 +1,22 @@
|
||||
import { prisma } from "@/module/_global";
|
||||
import { funGetUserByCookies } from "@/module/auth";
|
||||
import _, { omit } from "lodash";
|
||||
import { NextRequest } from "next/server";
|
||||
|
||||
export async function getAllPosition(req: NextRequest) {
|
||||
try {
|
||||
|
||||
let grupFix
|
||||
const searchParams = req.nextUrl.searchParams
|
||||
const groupID = "3";
|
||||
const groupID = searchParams.get('groupId');
|
||||
const active = searchParams.get('active');
|
||||
const user = await funGetUserByCookies()
|
||||
console.log(groupID)
|
||||
|
||||
// if(user.)
|
||||
|
||||
|
||||
|
||||
const positions = await prisma.position.findMany({
|
||||
where: {
|
||||
idGroup: String(groupID),
|
||||
|
||||
Reference in New Issue
Block a user