Progres dan Bursa Investasi

# fix:
- Bar progres berfungsi
- Urutan bursa investasi
# No issue
This commit is contained in:
2023-12-19 15:47:54 +08:00
parent 8ee62b875d
commit 414cf8f776
104 changed files with 1307 additions and 513 deletions

View File

@@ -6,28 +6,64 @@ import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
import moment from "moment";
import { revalidatePath } from "next/cache";
export default async function funGantiStatusInvestasi(id: string, val: string) {
const publishCD = new Date
const data = await prisma.investasi.update({
where: {
id: id,
},
data: {
MasterStatusInvestasi: {
connect: {
id: val,
export default async function funGantiStatusInvestasi(
id: string,
statusInves: string,
statusProgres?: string
) {
console.log(statusProgres)
if (statusProgres === '1') {
const publishCD = new Date();
const data = await prisma.investasi.update({
where: {
id: id,
},
data: {
MasterStatusInvestasi: {
connect: {
id: statusInves,
},
},
countDown: publishCD,
MasterProgresInvestasi: {
connect: {
id: statusProgres,
},
},
},
countDown: publishCD,
},
});
});
if (!data) return { status: 400 };
if (!data) return { status: 400 };
revalidatePath(RouterInvestasi.portofolio);
revalidatePath(RouterAdminInvestasi.main_investasi);
revalidatePath(RouterInvestasi.portofolio);
revalidatePath(RouterAdminInvestasi.main_investasi);
return {
status: 200,
};
return {
status: 200,
};
} else {
const publishCD = new Date();
const data = await prisma.investasi.update({
where: {
id: id,
},
data: {
MasterStatusInvestasi: {
connect: {
id: statusInves,
},
},
countDown: publishCD,
},
});
if (!data) return { status: 400 };
revalidatePath(RouterInvestasi.portofolio);
revalidatePath(RouterAdminInvestasi.main_investasi);
return {
status: 200,
};
}
}