fix: task

Deskripsi:
- progress error
- data tugas kosong
- file kosong
- anggota kosong
- csv dimatiin
- modal konfirmasi loading

No Issues
This commit is contained in:
amel
2024-09-26 11:18:19 +08:00
parent 0afde113ac
commit b1a71d3d41
9 changed files with 30 additions and 22 deletions

View File

@@ -44,14 +44,23 @@ export async function GET(request: Request, context: { params: { id: string } })
}
})
const semua = dataProgress.length
const selesai = _.filter(dataProgress, { status: 1 }).length
const progress = Math.ceil((selesai / semua) * 100)
if (dataProgress.length > 0) {
const semua = dataProgress.length
const selesai = _.filter(dataProgress, { status: 1 }).length
const progress = Math.ceil((selesai / semua) * 100)
allData = {
progress: progress,
lastUpdate: moment(dataProgress[0].updatedAt).format("DD MMMM YYYY"),
allData = {
progress: progress,
lastUpdate: moment(dataProgress[0]?.updatedAt).format("DD MMMM YYYY"),
}
} else {
allData = {
progress: 0,
lastUpdate: '1 Januari 1999',
}
}
} else if (kategori == "task") {
const dataProgress = await prisma.divisionProjectTask.findMany({
where: {

View File

@@ -68,6 +68,9 @@ export async function GET(request: Request) {
idUser: true
}
}
},
orderBy: {
createdAt: "desc"
}
});