Merge pull request #247 from bipproduction/bagas/17-jan-25

Fix notifikasi donasi & event new fiture
This commit is contained in:
Bagasbanuna02
2025-01-20 11:34:36 +08:00
committed by GitHub
24 changed files with 493 additions and 325 deletions

View File

@@ -68,18 +68,3 @@ export async function GET(
);
}
}
async function main({ id }: { id: string }) {
const fixData = await prisma.beritaInvestasi.findMany({
take: 10,
skip: 0,
orderBy: {
updatedAt: "desc",
},
where: {
investasiId: id.trim(),
active: true,
},
});
console.log("data sebelum disconnect>>", fixData);
}

View File

@@ -0,0 +1,46 @@
import { prisma } from "@/app/lib";
import { NextResponse } from "next/server";
export async function GET(request: Request) {
if (request.method === "GET") {
try {
let fixData;
const { searchParams } = new URL(request.url);
const except_id = searchParams.get("except-id");
if (!except_id) {
fixData = await prisma.user.findMany({
where: {
active: true,
},
});
} else {
fixData = await prisma.user.findMany({
where: {
active: true,
masterUserRoleId: "1",
id: {
not: except_id,
},
},
});
}
return NextResponse.json({
success: true,
message: "Berhasil mendapatkan data",
data: fixData,
});
} catch (error) {
return NextResponse.json({
success: false,
message: "Gagal mendapatkan data",
});
}
} else {
return NextResponse.json({
success: false,
message: "Method not allowed",
});
}
}

View File

@@ -1,10 +1,9 @@
import { Donasi_CreateKabar } from "@/app_modules/donasi";
export default async function Page({ params }: { params: { id: string } }) {
const donasiId = params.id;
export default async function Page() {
return (
<>
<Donasi_CreateKabar donasiId={donasiId} />
<Donasi_CreateKabar />
</>
);
}

View File

@@ -1,9 +1,12 @@
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { Notifikasi_UiMain } from "@/app_modules/notifikasi/_ui";
export default async function Page() {
const userLoginId = await funGetUserIdByToken();
return (
<>
<Notifikasi_UiMain />
<Notifikasi_UiMain userLoginId={userLoginId} />
</>
);
}

View File

@@ -1,9 +1,11 @@
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { Notifikasi_UiMain } from "@/app_modules/notifikasi/_ui";
export default async function Page() {
const userLoginId = await funGetUserIdByToken();
return (
<>
<Notifikasi_UiMain />
<Notifikasi_UiMain userLoginId={userLoginId} />
</>
);
}

View File

@@ -27,6 +27,4 @@ process.on("SIGINT", async () => {
process.exit(0);
});
// console.log("==> Test prisma");
export default prisma;