fix:
Deksripsi: - Progress investasi - Tampilan voting ## No issue
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
interface Model_Invoice_Masuk {
|
||||
total: number;
|
||||
@@ -14,7 +14,7 @@ export async function investasi_funCreateInvoice({
|
||||
}: {
|
||||
data: Model_Invoice_Masuk;
|
||||
}) {
|
||||
const authorId = await user_getOneUserId();
|
||||
const authorId = await user_funGetOneUserId();
|
||||
|
||||
const create = await prisma.investasi_Invoice.create({
|
||||
data: {
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function investasi_funGetAllPublishByUserId({
|
||||
page,
|
||||
}: {
|
||||
page: number;
|
||||
}) {
|
||||
const authorId = await user_funGetOneUserId();
|
||||
const takeData = 10;
|
||||
const skipData = page * takeData - takeData;
|
||||
|
||||
const data = await prisma.investasi.findMany({
|
||||
take: takeData,
|
||||
skip: skipData,
|
||||
orderBy: {
|
||||
countDown: "desc",
|
||||
},
|
||||
where: {
|
||||
authorId: authorId,
|
||||
masterStatusInvestasiId: "1",
|
||||
},
|
||||
include: {
|
||||
MasterPencarianInvestor: true,
|
||||
},
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function investasi_funGetAllInvestasiNonPublishByUserId({
|
||||
page,
|
||||
statusId,
|
||||
}: {
|
||||
page: number;
|
||||
statusId: string;
|
||||
}) {
|
||||
const authorId = await user_funGetOneUserId();
|
||||
const takeData = 10;
|
||||
const skipData = page * takeData - takeData;
|
||||
|
||||
const data = await prisma.investasi.findMany({
|
||||
take: takeData,
|
||||
skip: skipData,
|
||||
orderBy: {
|
||||
updatedAt: "desc",
|
||||
},
|
||||
where: {
|
||||
authorId: authorId,
|
||||
masterStatusInvestasiId: statusId,
|
||||
},
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function investasi_funGetTransaksiByUserId({
|
||||
page,
|
||||
}: {
|
||||
page: number;
|
||||
}) {
|
||||
const authorId = await user_getOneUserId();
|
||||
const authorId = await user_funGetOneUserId();
|
||||
const takeData = 10;
|
||||
const skipData = page * takeData - takeData;
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
"use server";
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
export async function investasi_funGetOneInvestasiById({investasiId}: {investasiId: string}) {
|
||||
export async function investasi_funGetOneInvestasiById({
|
||||
investasiId,
|
||||
}: {
|
||||
investasiId: string;
|
||||
}) {
|
||||
const data = await prisma.investasi.findUnique({
|
||||
where: {
|
||||
id: investasiId,
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function investasi_funGetSuccessTransactionById({
|
||||
page,
|
||||
}: {
|
||||
page: number;
|
||||
}) {
|
||||
const authorId = await user_getOneUserId();
|
||||
const authorId = await user_funGetOneUserId();
|
||||
const takeData = 10;
|
||||
const skipData = page * takeData - takeData;
|
||||
|
||||
|
||||
@@ -3,9 +3,16 @@ import { investasi_funGetOneInvestasiById } from "./get/fun_get_one_investasi_by
|
||||
import { investasi_funGetTransaksiByUserId } from "./get/fun_get_all_transaksi_by_user_id";
|
||||
import { investasi_funUploadBuktiTransferById } from "./upload/fun_upload_bukti_transfer";
|
||||
import { investasi_funGetSuccessTransactionById } from "./get/fun_get_success_transaction_by_id";
|
||||
import { investasi_funGetAllPublishByUserId } from "./get/fun_get_all_investasi_by_user_id";
|
||||
import { investasi_funGetAllInvestasiNonPublishByUserId } from "./get/fun_get_all_investasi_non_publish_by_user_id";
|
||||
|
||||
// Get
|
||||
export { investasi_funGetOneInvestasiById };
|
||||
export { investasi_funGetProspekById };
|
||||
export { investasi_funUploadBuktiTransferById };
|
||||
export { investasi_funGetTransaksiByUserId };
|
||||
export { investasi_funGetSuccessTransactionById };
|
||||
export { investasi_funGetAllPublishByUserId };
|
||||
export { investasi_funGetAllInvestasiNonPublishByUserId };
|
||||
|
||||
// Upload
|
||||
export { investasi_funUploadBuktiTransferById };
|
||||
|
||||
Reference in New Issue
Block a user