# feat:
- Deskripsi: - Notifikasi collaboration ## Issue: Scroll dari chat akan di ubah dengan package yang mas malik buat
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
import notifikasi_getByUserId from "../fun/get/get_notifiaksi_by_id";
|
||||
import { redirectVotingPage } from "./path/voting";
|
||||
import { redirectEventPage } from "./path/event";
|
||||
import { redirectDetailCollaborationPage } from "./path/collaboration";
|
||||
|
||||
export function ComponentNotifiaksi_CardView({
|
||||
data,
|
||||
@@ -42,7 +43,6 @@ export function ComponentNotifiaksi_CardView({
|
||||
}}
|
||||
my={"xs"}
|
||||
onClick={async () => {
|
||||
|
||||
await notifikasi_funUpdateIsReadById({
|
||||
notifId: data?.id,
|
||||
});
|
||||
@@ -53,6 +53,7 @@ export function ComponentNotifiaksi_CardView({
|
||||
// });
|
||||
// onLoadData(loadData);
|
||||
// }
|
||||
console.log(data.status);
|
||||
|
||||
data?.kategoriApp === "JOB" &&
|
||||
redirectJobPage({
|
||||
@@ -86,6 +87,12 @@ export function ComponentNotifiaksi_CardView({
|
||||
onSetMenu(val);
|
||||
},
|
||||
});
|
||||
|
||||
data?.kategoriApp === "COLLABORATION" &&
|
||||
redirectDetailCollaborationPage({
|
||||
data: data,
|
||||
router: router,
|
||||
});
|
||||
}}
|
||||
>
|
||||
{/* <pre>{JSON.stringify(e, null, 2)}</pre> */}
|
||||
|
||||
33
src/app_modules/notifikasi/component/path/collaboration.ts
Normal file
33
src/app_modules/notifikasi/component/path/collaboration.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
||||
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
|
||||
import { MODEL_NOTIFIKASI } from "../../model/interface";
|
||||
|
||||
export function redirectDetailCollaborationPage({
|
||||
data,
|
||||
router,
|
||||
}: {
|
||||
data: MODEL_NOTIFIKASI;
|
||||
router: AppRouterInstance;
|
||||
}) {
|
||||
if (data.status === "Partisipan Project") {
|
||||
const path = RouterColab.main_detail + data.appId;
|
||||
router.push(path, { scroll: false });
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (data.status === "Collaboration Group") {
|
||||
const path = RouterColab.grup_diskusi;
|
||||
router.push(path, { scroll: false });
|
||||
}
|
||||
|
||||
// if (data.status === "Report Komentar") {
|
||||
// const path = RouterForum.detail_report_komentar + data.appId;
|
||||
// router.push(path, { scroll: false });
|
||||
// }
|
||||
|
||||
// if (data.status === "Report Posting") {
|
||||
// const path = RouterForum.detail_report_posting + data.appId;
|
||||
// router.push(path, { scroll: false });
|
||||
// }
|
||||
}
|
||||
@@ -30,7 +30,7 @@ export function redirectEventPage({
|
||||
router.push(path, { scroll: false });
|
||||
}
|
||||
|
||||
if (data.status === "Peserta event") {
|
||||
if (data.status === "Peserta Event") {
|
||||
router.push(RouterEvent.detail_main + data.appId, { scroll: false });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
export async function notifikasiToUser_CreateGroupCollaboration({
|
||||
colabId,
|
||||
}: {
|
||||
colabId: string;
|
||||
}) {
|
||||
const userPartisipasi =
|
||||
await prisma.projectCollaboration_Partisipasi.findMany({
|
||||
where: {
|
||||
ProjectCollaboration: {
|
||||
id: colabId,
|
||||
},
|
||||
},
|
||||
select: {
|
||||
// User: true,
|
||||
userId: true,
|
||||
// ProjectCollaboration: {
|
||||
// select: {
|
||||
// id
|
||||
// title: true
|
||||
// }
|
||||
// },
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
|
||||
console.log(userPartisipasi);
|
||||
}
|
||||
@@ -8,13 +8,25 @@ export interface MODEL_NOTIFIKASI {
|
||||
appId: string;
|
||||
kategoriApp: string;
|
||||
isRead: boolean;
|
||||
title: string,
|
||||
title: string;
|
||||
pesan: string;
|
||||
User: MODEL_USER;
|
||||
userId: string;
|
||||
Admin: MODEL_USER;
|
||||
adminId: string;
|
||||
status?: string;
|
||||
status?:
|
||||
| "Publish"
|
||||
| "Reject"
|
||||
| "Review"
|
||||
| "Draft"
|
||||
| "Voting Masuk"
|
||||
| "Voting Selesai"
|
||||
| "Voting Selesai"
|
||||
| "Peserta Event"
|
||||
| "Report Komentar"
|
||||
| "Report Posting"
|
||||
| "Partisipan Project"
|
||||
| "Collaboration Group";
|
||||
Role: MODEL_NEW_DEFAULT_MASTER;
|
||||
userRoleId: String;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user