## Deskripsi :
- Notifikasi investasi
## Issue : Gerbang pembayaran
This commit is contained in:
2024-08-12 10:20:28 +08:00
parent 7131e93a49
commit 6ffeb097e8
188 changed files with 4409 additions and 2488 deletions

View File

@@ -0,0 +1,46 @@
"use server";
import prisma from "@/app/lib/prisma";
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
import { revalidatePath } from "next/cache";
export async function adminInvestasi_funEditStatusPublishById({
investasiId,
statusId,
progesInvestasiId,
}: {
investasiId: string;
statusId: string;
progesInvestasiId: string;
}) {
const publishTime = new Date();
const res = await prisma.investasi.update({
where: {
id: investasiId,
},
data: {
countDown: publishTime,
masterStatusInvestasiId: statusId,
masterProgresInvestasiId: progesInvestasiId,
},
select: {
id: true,
title: true,
authorId: true,
MasterStatusInvestasi: {
select: {
name: true,
},
},
}
});
if (!res) return { status: 400, message: "Gagal Update" };
revalidatePath(RouterInvestasi.portofolio);
return {
data: res,
status: 200,
message: "Publish Berhasil",
};
}