upd: tampilan kegiatan dan tugas divisi

Deskripsi:
- menambahkan chart progres pada list kegiatan
- menambahkan label status pada list tugas divisi

No Issues
This commit is contained in:
amel
2025-02-05 12:00:37 +08:00
parent 52aafa9fe5
commit 9679b5d326
4 changed files with 49 additions and 15 deletions

View File

@@ -1,7 +1,7 @@
import { DIR, funSendWebPush, funUploadFile, prisma } from "@/module/_global";
import { funGetUserByCookies } from "@/module/auth";
import { createLogUser } from "@/module/user";
import _ from "lodash";
import _, { ceil } from "lodash";
import { NextResponse } from "next/server";
@@ -94,6 +94,15 @@ export async function GET(request: Request) {
select: {
idUser: true
}
},
ProjectTask: {
where: {
isActive: true
},
select: {
title: true,
status: true
}
}
},
orderBy: {
@@ -102,11 +111,11 @@ export async function GET(request: Request) {
})
const omitData = data.map((v: any) => ({
..._.omit(v, ["ProjectMember"]),
..._.omit(v, ["ProjectMember", "ProjectTask"]),
progress: ceil((v.ProjectTask.filter((i: any) => i.status == 1).length * 100) / v.ProjectTask.length),
member: v.ProjectMember.length
}))
const totalData = await prisma.project.count({
where: kondisi
})