Fix notifikasi

Deskripsi:
- Fix notifikasi investasi
This commit is contained in:
2024-12-24 16:48:09 +08:00
parent 4a62205d8b
commit 0ca12c5318
24 changed files with 618 additions and 394 deletions

View File

@@ -60,15 +60,26 @@ export async function adminInvestasi_funAcceptTransaksiById({
lembarTerbeli: resultLembarTerbeli.toString(),
progress: resultProgres,
},
include: {
MasterStatusInvestasi: true,
},
});
if (!updateInvestasi)
return { status: 400, message: "Gagal Update Data Investasi" };
const newData = updateInvestasi;
const allData = {
dataInvestasi: updateInvestasi,
dataInvestor: updt,
};
revalidatePath(RouterAdminInvestasi.detail_publish);
return {
status: 200,
message: "Update Berhasil",
data: allData,
};
}
}

View File

@@ -9,9 +9,6 @@ export async function adminInvestasi_funRejectInvoiceById({
}: {
invoiceId: string;
}) {
const updt = await prisma.investasi_Invoice.update({
where: {
id: invoiceId,
@@ -19,12 +16,19 @@ export async function adminInvestasi_funRejectInvoiceById({
data: {
statusInvoiceId: "4",
},
select: {
StatusInvoice: true,
authorId: true,
},
});
if (!updt) return { status: 400, message: "Gagal Update" };
if (!updt)
return { status: 400, message: "Gagal Melakukan Reject", statusName: "" , userId: ""};
revalidatePath(RouterAdminInvestasi.detail_publish);
return {
status: 200,
message: "Update Berhasil",
message: "Reject Berhasil",
statusName: updt.StatusInvoice?.name,
userId: updt.authorId,
};
}