Update Versi 1.5.27 #32

Merged
bagasbanuna merged 1009 commits from staging into main 2025-12-17 12:22:28 +08:00
2158 changed files with 93806 additions and 24373 deletions
Showing only changes of commit a3f9592cfc - Show all commits

View File

@@ -14,19 +14,36 @@ async function GET(
const fixStatusName = _.startCase(status); const fixStatusName = _.startCase(status);
console.log("[STATUS]", fixStatusName); console.log("[STATUS]", fixStatusName);
const data = await prisma.voting.findMany({ let fixData;
where: {
authorId: id, if (fixStatusName === "Publish") {
Voting_Status: { fixData = await prisma.voting.findMany({
name: fixStatusName, where: {
authorId: id,
isActive: true,
akhirVote: {
gte: new Date(),
},
Voting_Status: {
name: fixStatusName,
},
}, },
}, });
}); } else {
fixData = await prisma.voting.findMany({
where: {
authorId: id,
Voting_Status: {
name: fixStatusName,
},
},
});
}
return NextResponse.json({ return NextResponse.json({
success: true, success: true,
message: "Success get voting", message: "Success get voting",
data: data, data: fixData,
}); });
} catch (error) { } catch (error) {
console.log("[ERROR]", error); console.log("[ERROR]", error);