Fix: Voting
Deskripsi: - Fix notifikasi admin to user - Fix notifikasi user to admin ## No Issue
This commit is contained in:
@@ -7,6 +7,17 @@ export async function Vote_funEditStatusByStatusId(
|
||||
voteId: string,
|
||||
statusId: string
|
||||
) {
|
||||
// if (statusId !== "2") {
|
||||
// const checkStatus = await prisma.voting.findFirst({
|
||||
// where: {
|
||||
// id: voteId,
|
||||
// },
|
||||
// });
|
||||
|
||||
// if (checkStatus?.voting_StatusId != "2")
|
||||
// return { status: 400, message: "Status sudah diubah admin" };
|
||||
// }
|
||||
|
||||
const updt = await prisma.voting.update({
|
||||
where: {
|
||||
id: voteId,
|
||||
|
||||
21
src/app_modules/vote/fun/get/fun_check_status.ts
Normal file
21
src/app_modules/vote/fun/get/fun_check_status.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
"use server";
|
||||
|
||||
import { prisma } from "@/app/lib";
|
||||
|
||||
export async function voting_checkStatus({
|
||||
id,
|
||||
}: {
|
||||
id: string;
|
||||
}) {
|
||||
const checkStatus = await prisma.voting.findFirst({
|
||||
where: {
|
||||
id: id,
|
||||
},
|
||||
});
|
||||
|
||||
if(checkStatus?.voting_StatusId == "2") return true
|
||||
return false
|
||||
|
||||
// if (checkStatus?.voting_StatusId == "2") return true;
|
||||
// return false;
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
import { voting_funUpdateIsArsipById } from "./edit/fun_update_is_arsip_by_id";
|
||||
import { voting_checkStatus } from "./get/fun_check_status";
|
||||
import { voting_getMasterStatus } from "./get/get_list_status_voting";
|
||||
import { vote_funGetAllByStatusId } from "./get/status/get_all_by_status_id";
|
||||
|
||||
export { voting_funUpdateIsArsipById };
|
||||
export { vote_funGetAllByStatusId };
|
||||
export { voting_getMasterStatus };
|
||||
export { voting_checkStatus };
|
||||
|
||||
Reference in New Issue
Block a user