# feat:
- Count jumlah perstatus
- Get data review untuk admin
### no issue
This commit is contained in:
2023-11-10 17:51:08 +08:00
parent 65548de7c8
commit 6e7be766b9
10 changed files with 177 additions and 50 deletions

View File

@@ -0,0 +1,65 @@
"use server";
import prisma from "@/app/lib/prisma";
import _ from "lodash";
/**
*
* @param id
*
* @type number
* @returns count of status investasi
*/
export default async function Admin_CountStatusInvestasi(id: number) {
if (id === 1) {
const count = await prisma.investasi.count({
where: {
MasterStatusInvestasi: {
name: {
equals: "Draft",
},
},
},
});
return count;
}
if (id === 2) {
const count = await prisma.investasi.count({
where: {
MasterStatusInvestasi: {
name: {
equals: "Review",
},
},
},
});
return count;
}
if (id === 3) {
const count = await prisma.investasi.count({
where: {
MasterStatusInvestasi: {
name: {
equals: "Publish",
},
},
},
});
return count;
}
if (id === 4) {
const count = await prisma.investasi.count({
where: {
MasterStatusInvestasi: {
name: {
equals: "Reject",
},
},
},
});
return count;
}
}