Progres dan Bursa Investasi
# fix: - Bar progres berfungsi - Urutan bursa investasi # No issue
This commit is contained in:
@@ -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,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user