fix
Deskripsi: - Upload ke stroage untuk job ## Np Issuee
This commit is contained in:
@@ -147,6 +147,7 @@ model Portofolio {
|
|||||||
logoId String?
|
logoId String?
|
||||||
Portofolio_MediaSosial Portofolio_MediaSosial?
|
Portofolio_MediaSosial Portofolio_MediaSosial?
|
||||||
BusinessMaps BusinessMaps?
|
BusinessMaps BusinessMaps?
|
||||||
|
imageId String?
|
||||||
}
|
}
|
||||||
|
|
||||||
model Portofolio_MediaSosial {
|
model Portofolio_MediaSosial {
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ export async function POST(req: Request) {
|
|||||||
name: "ssn",
|
name: "ssn",
|
||||||
value: res,
|
value: res,
|
||||||
maxAge: 60 * 60 * 24 * 7,
|
maxAge: 60 * 60 * 24 * 7,
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
revalidatePath("/dev/home");
|
revalidatePath("/dev/home");
|
||||||
|
|||||||
@@ -1,19 +1,14 @@
|
|||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { cookies } from "next/headers";
|
import { cookies } from "next/headers";
|
||||||
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
export async function GET(req: Request) {
|
export async function GET(req: Request) {
|
||||||
try {
|
const cekCookies = cookies();
|
||||||
const cekCookies = cookies();
|
const c = cekCookies.get("ssn");
|
||||||
const c = cekCookies.get("ssn");
|
|
||||||
|
|
||||||
if (!c || !c?.value || _.isEmpty(c?.value) || _.isUndefined(c?.value)) {
|
if (!c || !c?.value || _.isEmpty(c?.value) || _.isUndefined(c?.value)) {
|
||||||
return Response.json({ success: false });
|
return NextResponse.json({ success: false });
|
||||||
}
|
// return new Response(JSON.stringify({ success: false }));
|
||||||
|
|
||||||
return Response.json({ success: true });
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
}
|
}
|
||||||
|
return NextResponse.json({ success: true });
|
||||||
return Response.json({ success: false });
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { AdminDonasi_TableReview } from "@/app_modules/admin/donasi";
|
import { AdminDonasi_TableReview } from "@/app_modules/admin/donasi";
|
||||||
import adminDonasi_getListReview from "@/app_modules/admin/donasi/fun/get/get_list_review";
|
import adminDonasi_getListReview from "@/app_modules/admin/donasi/fun/get/get_list_review";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const listReview = await adminDonasi_getListReview({page: 1});
|
const listReview = await adminDonasi_getListReview({page: 1});
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { AdminLayout } from "@/app_modules/admin/main_dashboard";
|
import { AdminLayout } from "@/app_modules/admin/main_dashboard";
|
||||||
import adminNotifikasi_countNotifikasi from "@/app_modules/admin/notifikasi/fun/count/count_is_read";
|
import adminNotifikasi_countNotifikasi from "@/app_modules/admin/notifikasi/fun/count/count_is_read";
|
||||||
import adminNotifikasi_getByUserId from "@/app_modules/admin/notifikasi/fun/get/get_notifikasi_by_user_id";
|
import adminNotifikasi_getByUserId from "@/app_modules/admin/notifikasi/fun/get/get_notifikasi_by_user_id";
|
||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id";
|
import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
@@ -11,10 +10,9 @@ export default async function Layout({
|
|||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
const userId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!userId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
const dataUser = await user_getOneByUserId(userId);
|
const dataUser = await user_getOneByUserId(userLoginId);
|
||||||
const listNotif = await adminNotifikasi_getByUserId();
|
const listNotif = await adminNotifikasi_getByUserId();
|
||||||
const countNotifikasi = await adminNotifikasi_countNotifikasi();
|
const countNotifikasi = await adminNotifikasi_countNotifikasi();
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Login } from "@/app_modules/auth";
|
import { Login } from "@/app_modules/auth";
|
||||||
|
|
||||||
export default function Page() {
|
export default async function Page() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Login />
|
<Login />
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { Register } from "@/app_modules/auth";
|
import { Register } from "@/app_modules/auth";
|
||||||
import { auth_getKodeOtpById } from "@/app_modules/auth/fun/get_kode_otp_by_id";
|
import { auth_getCodeOtpByNumber } from "@/app_modules/auth/fun/get_kode_otp_by_id";
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
let otpId = params.id
|
let otpId = params.id;
|
||||||
const dataOtp = await auth_getKodeOtpById(otpId)
|
const dataOtp = await auth_getCodeOtpByNumber({ kodeId: otpId });
|
||||||
return <Register dataOtp={dataOtp} />;
|
return <Register dataOtp={dataOtp} />;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { SplashScreen } from "@/app_modules/auth";
|
import { SplashScreen } from "@/app_modules/auth";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global";
|
|
||||||
|
|
||||||
export default async function PageSplash() {
|
export default async function PageSplash() {
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import { Validasi } from "@/app_modules/auth";
|
import { Validasi } from "@/app_modules/auth";
|
||||||
import { auth_getKodeOtpById } from "@/app_modules/auth/fun/get_kode_otp_by_id";
|
import { auth_getCodeOtpByNumber } from "@/app_modules/auth/fun/get_kode_otp_by_id";
|
||||||
import { ServerEnv } from "@/app/lib/server_env";
|
import { redirect } from "next/navigation";
|
||||||
|
import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
let nomor = params.id;
|
let kodeId = params.id;
|
||||||
const dataOtp = await auth_getKodeOtpById({nomor: nomor});
|
const dataOtp = await auth_getCodeOtpByNumber({ kodeId: kodeId });
|
||||||
|
if (dataOtp === null) return redirect(RouterAuth.login);
|
||||||
|
|
||||||
return <Validasi dataOtp={dataOtp} />;
|
return <Validasi dataOtp={dataOtp} />;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,13 @@
|
|||||||
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import adminColab_getOneRoomChatById from "@/app_modules/admin/colab/fun/get/get_one_room_chat_by_id";
|
import adminColab_getOneRoomChatById from "@/app_modules/admin/colab/fun/get/get_one_room_chat_by_id";
|
||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
import { Colab_GroupChatView } from "@/app_modules/colab";
|
||||||
import {
|
|
||||||
Colab_DetailGrupDiskusi,
|
|
||||||
Colab_GroupChatView,
|
|
||||||
} from "@/app_modules/colab";
|
|
||||||
import colab_getMessageByRoomId from "@/app_modules/colab/fun/get/room_chat/get_message_by_room_id";
|
import colab_getMessageByRoomId from "@/app_modules/colab/fun/get/room_chat/get_message_by_room_id";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id";
|
import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
const roomId = params.id;
|
const roomId = params.id;
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
const getData = (await adminColab_getOneRoomChatById({ roomId: roomId }))
|
const getData = (await adminColab_getOneRoomChatById({ roomId: roomId }))
|
||||||
.data;
|
.data;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { LayoutColab_MainDetail } from "@/app_modules/colab";
|
import { LayoutColab_MainDetail } from "@/app_modules/colab";
|
||||||
import colab_getOneCollaborationById from "@/app_modules/colab/fun/get/get_one_by_id";
|
import colab_getOneCollaborationById from "@/app_modules/colab/fun/get/get_one_by_id";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
export default async function Layout({
|
export default async function Layout({
|
||||||
@@ -11,9 +11,10 @@ export default async function Layout({
|
|||||||
params: { id: string };
|
params: { id: string };
|
||||||
}) {
|
}) {
|
||||||
const colabId = params.id;
|
const colabId = params.id;
|
||||||
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const dataColab = await colab_getOneCollaborationById(colabId);
|
const dataColab = await colab_getOneCollaborationById(colabId);
|
||||||
const authorId = dataColab?.Author?.id;
|
const authorId = dataColab?.Author?.id;
|
||||||
const userLoginId = await user_funGetOneUserId();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { Colab_MainDetail } from "@/app_modules/colab";
|
import { Colab_MainDetail } from "@/app_modules/colab";
|
||||||
import colab_funCekPartisipasiById from "@/app_modules/colab/fun/get/cek_partisipasi_by_user_id";
|
import colab_funCekPartisipasiById from "@/app_modules/colab/fun/get/cek_partisipasi_by_user_id";
|
||||||
import colab_getListPartisipanByColabId from "@/app_modules/colab/fun/get/get_list_partisipan_by_id";
|
import colab_getListPartisipanByColabId from "@/app_modules/colab/fun/get/get_list_partisipan_by_id";
|
||||||
import colab_getOneCollaborationById from "@/app_modules/colab/fun/get/get_one_by_id";
|
import colab_getOneCollaborationById from "@/app_modules/colab/fun/get/get_one_by_id";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
let colabId = params.id;
|
let colabId = params.id;
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
const dataColab = await colab_getOneCollaborationById(colabId);
|
const dataColab = await colab_getOneCollaborationById(colabId);
|
||||||
const listPartisipan = await colab_getListPartisipanByColabId(colabId);
|
const listPartisipan = await colab_getListPartisipanByColabId(colabId);
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { Colab_Beranda } from "@/app_modules/colab";
|
import { Colab_Beranda } from "@/app_modules/colab";
|
||||||
import colab_getListAllProyek from "@/app_modules/colab/fun/get/get_list_all_proyek";
|
import colab_getListAllProyek from "@/app_modules/colab/fun/get/get_list_all_proyek";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const listData = await colab_getListAllProyek({ page: 1 });
|
const listData = await colab_getListAllProyek({ page: 1 });
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { CreateCeritaPenggalangDonasi } from "@/app_modules/donasi";
|
import { CreateCeritaPenggalangDonasi } from "@/app_modules/donasi";
|
||||||
import { Donasi_getTemporaryCreate } from "@/app_modules/donasi/fun/get/get_temporary_create";
|
import { Donasi_getTemporaryCreate } from "@/app_modules/donasi/fun/get/get_temporary_create";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
const getTemporaryCreate = await Donasi_getTemporaryCreate(params.id);
|
const getTemporaryCreate = await Donasi_getTemporaryCreate(params.id);
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import {
|
|||||||
Donasi_getMasterDurasi,
|
Donasi_getMasterDurasi,
|
||||||
Donasi_getMasterKategori,
|
Donasi_getMasterKategori,
|
||||||
} from "@/app_modules/donasi/fun";
|
} from "@/app_modules/donasi/fun";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const masterKategori = await Donasi_getMasterKategori();
|
const masterKategori = await Donasi_getMasterKategori();
|
||||||
|
|||||||
@@ -1,20 +1,22 @@
|
|||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { DetailMainDonasi } from "@/app_modules/donasi";
|
import { DetailMainDonasi } from "@/app_modules/donasi";
|
||||||
import { Donasi_getCountDonatur } from "@/app_modules/donasi/fun/count/get_count_donatur";
|
import { Donasi_getCountDonatur } from "@/app_modules/donasi/fun/count/get_count_donatur";
|
||||||
import { Donasi_getOneById } from "@/app_modules/donasi/fun/get/get_one_donasi_by_id";
|
import { Donasi_getOneById } from "@/app_modules/donasi/fun/get/get_one_donasi_by_id";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
let donasiId = params.id;
|
let donasiId = params.id;
|
||||||
const dataDonasi = await Donasi_getOneById(donasiId);
|
const userLoginId = await funGetUserIdByToken();
|
||||||
const countDonatur = await Donasi_getCountDonatur(donasiId)
|
|
||||||
const userLoginId = await user_funGetOneUserId();
|
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
|
const dataDonasi = await Donasi_getOneById(donasiId);
|
||||||
|
const countDonatur = await Donasi_getCountDonatur(donasiId);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<DetailMainDonasi dataDonasi={dataDonasi as any} countDonatur={countDonatur} userLoginId={userLoginId}/>
|
<DetailMainDonasi
|
||||||
|
dataDonasi={dataDonasi as any}
|
||||||
|
countDonatur={countDonatur}
|
||||||
|
userLoginId={userLoginId}
|
||||||
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,12 @@
|
|||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { DetailPublishDonasi } from "@/app_modules/donasi";
|
import { DetailPublishDonasi } from "@/app_modules/donasi";
|
||||||
import { Donasi_getCountDonatur } from "@/app_modules/donasi/fun/count/get_count_donatur";
|
import { Donasi_getCountDonatur } from "@/app_modules/donasi/fun/count/get_count_donatur";
|
||||||
import { Donasi_getOneById } from "@/app_modules/donasi/fun/get/get_one_donasi_by_id";
|
import { Donasi_getOneById } from "@/app_modules/donasi/fun/get/get_one_donasi_by_id";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
const dataPublish = await Donasi_getOneById(params.id);
|
const dataPublish = await Donasi_getOneById(params.id);
|
||||||
const countDonatur = await Donasi_getCountDonatur(params.id);
|
const countDonatur = await Donasi_getCountDonatur(params.id);
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
// console.log(userLoginId)
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
import { PostingDonasi } from "@/app_modules/donasi";
|
import { PostingDonasi } from "@/app_modules/donasi";
|
||||||
import Donasi_getByStatus from "@/app_modules/donasi/fun/get/get_donasi_by_status";
|
|
||||||
import { donasi_funGetAllStatusDraft } from "@/app_modules/donasi/fun/get/status/get_all_status_draft";
|
import { donasi_funGetAllStatusDraft } from "@/app_modules/donasi/fun/get/status/get_all_status_draft";
|
||||||
import { donasi_funGetAllStatusPublish } from "@/app_modules/donasi/fun/get/status/get_all_status_publish";
|
import { donasi_funGetAllStatusPublish } from "@/app_modules/donasi/fun/get/status/get_all_status_publish";
|
||||||
import { donasi_funGetAllStatusReject } from "@/app_modules/donasi/fun/get/status/get_all_status_reject";
|
import { donasi_funGetAllStatusReject } from "@/app_modules/donasi/fun/get/status/get_all_status_reject";
|
||||||
import { donasi_funGetAllStatusReview } from "@/app_modules/donasi/fun/get/status/get_all_status_review";
|
import { donasi_funGetAllStatusReview } from "@/app_modules/donasi/fun/get/status/get_all_status_review";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const authorId = await user_funGetOneUserId();
|
const listPublish = await donasi_funGetAllStatusPublish({ page: 1 });
|
||||||
const listPublish = await donasi_funGetAllStatusPublish({page: 1});
|
const listReview = await donasi_funGetAllStatusReview({ page: 1 });
|
||||||
const listReview = await donasi_funGetAllStatusReview({page: 1});
|
const listDraft = await donasi_funGetAllStatusDraft({ page: 1 });
|
||||||
const listDraft = await donasi_funGetAllStatusDraft({page: 1});
|
const listReject = await donasi_funGetAllStatusReject({ page: 1 });
|
||||||
const listReject = await donasi_funGetAllStatusReject({page: 1});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<PostingDonasi listPublish={listPublish} listReview={listReview} listDraft={listDraft} listReject={listReject} />
|
<PostingDonasi
|
||||||
|
listPublish={listPublish}
|
||||||
|
listReview={listReview}
|
||||||
|
listDraft={listDraft}
|
||||||
|
listReject={listReject}
|
||||||
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { LayoutDonasi } from "@/app_modules/donasi";
|
import { LayoutDonasi } from "@/app_modules/donasi";
|
||||||
import { Donasi_getNotifByUserId } from "@/app_modules/donasi/fun/get/get_notif_by_user_id";
|
import { Donasi_getNotifByUserId } from "@/app_modules/donasi/fun/get/get_notif_by_user_id";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
export default async function Layout({
|
export default async function Layout({
|
||||||
@@ -9,8 +8,7 @@ export default async function Layout({
|
|||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
const isRead = await Donasi_getNotifByUserId(userLoginId).then((res: any) =>
|
const isRead = await Donasi_getNotifByUserId(userLoginId).then((res: any) =>
|
||||||
res.map((val: any) => val.isRead)
|
res.map((val: any) => val.isRead)
|
||||||
|
|||||||
@@ -1,16 +1,19 @@
|
|||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { Donasi_MetodePembayaran } from "@/app_modules/donasi";
|
import { Donasi_MetodePembayaran } from "@/app_modules/donasi";
|
||||||
import { Donasi_getMasterBank } from "@/app_modules/donasi/fun/master/get_bank";
|
import { Donasi_getMasterBank } from "@/app_modules/donasi/fun/master/get_bank";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
|
|
||||||
export default async function Page({params}: {params: {id: string}}) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
let donasiId= params.id
|
let donasiId = params.id;
|
||||||
const listBank = await Donasi_getMasterBank()
|
const listBank = await Donasi_getMasterBank();
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
|
return (
|
||||||
return<>
|
<>
|
||||||
<Donasi_MetodePembayaran listBank={listBank} donasiId={donasiId} authorId={userLoginId}/>
|
<Donasi_MetodePembayaran
|
||||||
|
listBank={listBank}
|
||||||
|
donasiId={donasiId}
|
||||||
|
authorId={userLoginId}
|
||||||
|
/>
|
||||||
</>
|
</>
|
||||||
}
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { Event_Create } from "@/app_modules/event";
|
import { Event_Create } from "@/app_modules/event";
|
||||||
import { Event_getMasterTipeAcara } from "@/app_modules/event/fun/master/get_tipe_acara";
|
import { Event_getMasterTipeAcara } from "@/app_modules/event/fun/master/get_tipe_acara";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import _ from "lodash";
|
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
const listTipeAcara = await Event_getMasterTipeAcara();
|
const listTipeAcara = await Event_getMasterTipeAcara();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,15 +1,13 @@
|
|||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { Event_DetailMain } from "@/app_modules/event";
|
import { Event_DetailMain } from "@/app_modules/event";
|
||||||
import { Event_countTotalPesertaById } from "@/app_modules/event/fun/count/count_total_peserta_by_id";
|
import { Event_countTotalPesertaById } from "@/app_modules/event/fun/count/count_total_peserta_by_id";
|
||||||
import { Event_CekUserJoinById } from "@/app_modules/event/fun/get/cek_user_join_by_id";
|
import { Event_CekUserJoinById } from "@/app_modules/event/fun/get/cek_user_join_by_id";
|
||||||
import { Event_getListPesertaById } from "@/app_modules/event/fun/get/get_list_peserta_by_id";
|
import { Event_getListPesertaById } from "@/app_modules/event/fun/get/get_list_peserta_by_id";
|
||||||
import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
|
import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
let eventId = params.id;
|
let eventId = params.id;
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
const dataEvent = await Event_getOneById(eventId);
|
const dataEvent = await Event_getOneById(eventId);
|
||||||
const listPeserta = await Event_getListPesertaById(eventId);
|
const listPeserta = await Event_getListPesertaById(eventId);
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
|
|
||||||
import { Event_DetailRiwayat } from "@/app_modules/event";
|
import { Event_DetailRiwayat } from "@/app_modules/event";
|
||||||
import { Event_countTotalPesertaById } from "@/app_modules/event/fun/count/count_total_peserta_by_id";
|
import { Event_countTotalPesertaById } from "@/app_modules/event/fun/count/count_total_peserta_by_id";
|
||||||
import { Event_CekUserJoinById } from "@/app_modules/event/fun/get/cek_user_join_by_id";
|
|
||||||
import { Event_getListPesertaById } from "@/app_modules/event/fun/get/get_list_peserta_by_id";
|
import { Event_getListPesertaById } from "@/app_modules/event/fun/get/get_list_peserta_by_id";
|
||||||
import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
|
import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
let eventId = params.id;
|
let eventId = params.id;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { Event_Kontribusi } from "@/app_modules/event";
|
import { Event_Kontribusi } from "@/app_modules/event";
|
||||||
import { event_getListKontibusiByUserId } from "@/app_modules/event/fun/get/get_list_kontribusi_by_user_id";
|
import { event_getListKontibusiByUserId } from "@/app_modules/event/fun/get/get_list_kontribusi_by_user_id";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const listKontribusi = await event_getListKontibusiByUserId({page: 1})
|
const listKontribusi = await event_getListKontibusiByUserId({page: 1})
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { Event_Riwayat } from "@/app_modules/event";
|
import { Event_Riwayat } from "@/app_modules/event";
|
||||||
import { event_getListRiwayatSaya } from "@/app_modules/event/fun/get/get_list_riwayat_saya";
|
import { event_getListRiwayatSaya } from "@/app_modules/event/fun/get/get_list_riwayat_saya";
|
||||||
import { event_getListSemuaRiwayat } from "@/app_modules/event/fun/get/riwayat/get_list_semua_riwayat";
|
import { event_getListSemuaRiwayat } from "@/app_modules/event/fun/get/riwayat/get_list_semua_riwayat";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
let eventId = params.id;
|
let eventId = params.id;
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { Event_StatusPage } from "@/app_modules/event";
|
import { Event_StatusPage } from "@/app_modules/event";
|
||||||
import { event_getAllDraft } from "@/app_modules/event/fun/get/status/get_all_draft";
|
import { event_getAllDraft } from "@/app_modules/event/fun/get/status/get_all_draft";
|
||||||
import { event_getAllReject } from "@/app_modules/event/fun/get/status/get_all_reject";
|
import { event_getAllReject } from "@/app_modules/event/fun/get/status/get_all_reject";
|
||||||
import { event_getAllReview } from "@/app_modules/event/fun/get/status/get_all_review";
|
import { event_getAllReview } from "@/app_modules/event/fun/get/status/get_all_review";
|
||||||
import { event_funGetAllStatusPublish } from "@/app_modules/event/fun/get/status/get_all_status_publish";
|
import { event_funGetAllStatusPublish } from "@/app_modules/event/fun/get/status/get_all_status_publish";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
const listPublish = await event_funGetAllStatusPublish({ page: 1 });
|
const listPublish = await event_funGetAllStatusPublish({ page: 1 });
|
||||||
const listReview = await event_getAllReview({ page: 1 });
|
const listReview = await event_getAllReview({ page: 1 });
|
||||||
|
|||||||
@@ -1,17 +1,14 @@
|
|||||||
|
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
|
||||||
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import Forum_MainDetail from "@/app_modules/forum/detail/main_detail";
|
import Forum_MainDetail from "@/app_modules/forum/detail/main_detail";
|
||||||
|
import { forum_countTotalKomenById } from "@/app_modules/forum/fun/count/count_total_komentar_by_id";
|
||||||
import { forum_funGetAllKomentarById } from "@/app_modules/forum/fun/get/get_all_komentar_by_id";
|
import { forum_funGetAllKomentarById } from "@/app_modules/forum/fun/get/get_all_komentar_by_id";
|
||||||
import { forum_getOnePostingById } from "@/app_modules/forum/fun/get/get_one_posting_by_id";
|
import { forum_getOnePostingById } from "@/app_modules/forum/fun/get/get_one_posting_by_id";
|
||||||
import { forum_countOneTotalKomentarById } from "@/app_modules/forum/fun/count/count_one_total_komentar_by_id";
|
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
|
|
||||||
import { redirect } from "next/navigation";
|
import { redirect } from "next/navigation";
|
||||||
import { forum_countTotalKomenById } from "@/app_modules/forum/fun/count/count_total_komentar_by_id";
|
|
||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
let postingId = params.id;
|
let postingId = params.id;
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
const dataPosting = await forum_getOnePostingById(postingId);
|
const dataPosting = await forum_getOnePostingById(postingId);
|
||||||
const listKomentar = await forum_funGetAllKomentarById({
|
const listKomentar = await forum_funGetAllKomentarById({
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { LayoutForum_Forumku } from "@/app_modules/forum";
|
import { LayoutForum_Forumku } from "@/app_modules/forum";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id";
|
import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { Forum_Forumku } from "@/app_modules/forum";
|
import { Forum_Forumku } from "@/app_modules/forum";
|
||||||
|
import { forum_countPostingByAuthorId } from "@/app_modules/forum/fun/count/count_posting_by_author_id";
|
||||||
import { forum_getAllPostingByAuhtorId } from "@/app_modules/forum/fun/get/get_list_posting_by_author_id";
|
import { forum_getAllPostingByAuhtorId } from "@/app_modules/forum/fun/get/get_list_posting_by_author_id";
|
||||||
import { forum_countOneTotalKomentarById } from "@/app_modules/forum/fun/count/count_one_total_komentar_by_id";
|
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id";
|
import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { forum_countPostingByAuthorId } from "@/app_modules/forum/fun/count/count_posting_by_author_id";
|
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
const authorId = params.id;
|
const authorId = params.id;
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const dataAuthor = await user_getOneByUserId(authorId);
|
const dataAuthor = await user_getOneByUserId(authorId);
|
||||||
const auhtorSelectedData = _.omit(dataAuthor, [
|
const auhtorSelectedData = _.omit(dataAuthor, [
|
||||||
"Profile.email",
|
"Profile.email",
|
||||||
@@ -25,7 +25,10 @@ export default async function Page({ params }: { params: { id: string } }) {
|
|||||||
// setTimeout(a, 1000);
|
// setTimeout(a, 1000);
|
||||||
// });
|
// });
|
||||||
|
|
||||||
const dataPosting = await forum_getAllPostingByAuhtorId({authorId: authorId, page: 1});
|
const dataPosting = await forum_getAllPostingByAuhtorId({
|
||||||
|
authorId: authorId,
|
||||||
|
page: 1,
|
||||||
|
});
|
||||||
const totalPosting = await forum_countPostingByAuthorId(authorId);
|
const totalPosting = await forum_countPostingByAuthorId(authorId);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { Forum_Komentar } from "@/app_modules/forum";
|
import { Forum_Komentar } from "@/app_modules/forum";
|
||||||
import { forum_getOnePostingById } from "@/app_modules/forum/fun/get/get_one_posting_by_id";
|
import { forum_getOnePostingById } from "@/app_modules/forum/fun/get/get_one_posting_by_id";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
let postingId = params.id;
|
let postingId = params.id;
|
||||||
const dataPosting = await forum_getOnePostingById(postingId);
|
const dataPosting = await forum_getOnePostingById(postingId);
|
||||||
const userLoginId = await user_funGetOneUserId()
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { LayoutForum_Main } from "@/app_modules/forum";
|
import { LayoutForum_Main } from "@/app_modules/forum";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id";
|
import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
@@ -9,14 +8,14 @@ export default async function Layout({
|
|||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
const dataAuthor = await user_getOneByUserId(userLoginId);
|
const dataAuthor = await user_getOneByUserId(userLoginId);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<LayoutForum_Main dataAuthor={dataAuthor as any}>{children}</LayoutForum_Main>
|
<LayoutForum_Main dataAuthor={dataAuthor as any}>
|
||||||
|
{children}
|
||||||
|
</LayoutForum_Main>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,10 @@
|
|||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { Forum_Beranda } from "@/app_modules/forum";
|
import { Forum_Beranda } from "@/app_modules/forum";
|
||||||
import { forum_new_getAllPosting } from "@/app_modules/forum/fun/get/new_get_all_posting";
|
import { forum_new_getAllPosting } from "@/app_modules/forum/fun/get/new_get_all_posting";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
const listForum = await forum_new_getAllPosting({ page: 1 });
|
const listForum = await forum_new_getAllPosting({ page: 1 });
|
||||||
|
|
||||||
|
|
||||||
// console.log(JSON.stringify(listForum, null, 2));
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { Forum_ReportKomentarLainnya } from "@/app_modules/forum";
|
import { Forum_ReportKomentarLainnya } from "@/app_modules/forum";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
let komentarId = params.id;
|
let komentarId = params.id;
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { Forum_ReportKomentar } from "@/app_modules/forum";
|
import { Forum_ReportKomentar } from "@/app_modules/forum";
|
||||||
import { forum_getMasterKategoriReport } from "@/app_modules/forum/fun/master/get_master_kategori_report";
|
import { forum_getMasterKategoriReport } from "@/app_modules/forum/fun/master/get_master_kategori_report";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
let komentarId = params.id;
|
let komentarId = params.id;
|
||||||
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const listReport = await forum_getMasterKategoriReport();
|
const listReport = await forum_getMasterKategoriReport();
|
||||||
const userLoginId = await user_funGetOneUserId();
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { Forum_ReportPostingLainnya } from "@/app_modules/forum";
|
import { Forum_ReportPostingLainnya } from "@/app_modules/forum";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
let postingId = params.id;
|
let postingId = params.id;
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { Forum_ReportPosting } from "@/app_modules/forum";
|
import { Forum_ReportPosting } from "@/app_modules/forum";
|
||||||
import { forum_getMasterKategoriReport } from "@/app_modules/forum/fun/master/get_master_kategori_report";
|
import { forum_getMasterKategoriReport } from "@/app_modules/forum/fun/master/get_master_kategori_report";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
let postingId = params.id;
|
let postingId = params.id;
|
||||||
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const listReport = await forum_getMasterKategoriReport();
|
const listReport = await forum_getMasterKategoriReport();
|
||||||
const userLoginId = await user_funGetOneUserId();
|
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { RouterAdminDashboard } from "@/app/lib/router_hipmi/router_admin";
|
import { RouterAdminDashboard } from "@/app/lib/router_hipmi/router_admin";
|
||||||
import { RouterHome } from "@/app/lib/router_hipmi/router_home";
|
import { RouterHome } from "@/app/lib/router_hipmi/router_home";
|
||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import { HomeView } from "@/app_modules/home";
|
import { HomeView } from "@/app_modules/home";
|
||||||
import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id";
|
import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id";
|
||||||
import { job_getTwoForHomeView } from "@/app_modules/job/fun/get/get_two_for_home_view";
|
import { job_getTwoForHomeView } from "@/app_modules/job/fun/get/get_two_for_home_view";
|
||||||
@@ -9,8 +8,7 @@ import notifikasi_countUserNotifikasi from "@/app_modules/notifikasi/fun/count/f
|
|||||||
import { redirect } from "next/navigation";
|
import { redirect } from "next/navigation";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
const dataUser = await user_getOneByUserId(userLoginId);
|
const dataUser = await user_getOneByUserId(userLoginId);
|
||||||
const dataJob = await job_getTwoForHomeView();
|
const dataJob = await job_getTwoForHomeView();
|
||||||
@@ -24,9 +22,6 @@ export default async function Page() {
|
|||||||
|
|
||||||
const countNotifikasi = await notifikasi_countUserNotifikasi();
|
const countNotifikasi = await notifikasi_countUserNotifikasi();
|
||||||
|
|
||||||
// const cekCookies = await fetch("/api/check-cookies");
|
|
||||||
// console.log(await cekCookies.json());
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<HomeView
|
<HomeView
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import { DetailInvestasi } from "@/app_modules/investasi";
|
import { DetailInvestasi } from "@/app_modules/investasi";
|
||||||
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
const investasiId = params.id;
|
const investasiId = params.id;
|
||||||
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const dataInvestasi = await getOneInvestasiById(investasiId);
|
const dataInvestasi = await getOneInvestasiById(investasiId);
|
||||||
const userLoginId = await user_funGetOneUserId();
|
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,26 +1,12 @@
|
|||||||
import { PortofolioInvestasi } from "@/app_modules/investasi";
|
|
||||||
import { cookies } from "next/headers";
|
|
||||||
import fs from "fs";
|
|
||||||
import yaml from "yaml";
|
|
||||||
import { unsealData } from "iron-session";
|
|
||||||
import getInvestasiByStatusId from "@/app_modules/investasi/fun/get_investasi_by_id";
|
|
||||||
import getStatusInvestasi from "@/app_modules/investasi/fun/master/get_status_investasi";
|
|
||||||
import getPortoByStatusId from "@/app_modules/investasi/fun/get_porto_status_by_id";
|
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import { Investasi_UiPortofolio } from "@/app_modules/investasi/_ui";
|
|
||||||
import {
|
import {
|
||||||
investasi_funGetAllInvestasiNonPublishByUserId,
|
investasi_funGetAllInvestasiNonPublishByUserId,
|
||||||
investasi_funGetAllPublishByUserId,
|
investasi_funGetAllPublishByUserId,
|
||||||
} from "@/app_modules/investasi/_fun";
|
} from "@/app_modules/investasi/_fun";
|
||||||
|
import { Investasi_UiPortofolio } from "@/app_modules/investasi/_ui";
|
||||||
|
import getStatusInvestasi from "@/app_modules/investasi/fun/master/get_status_investasi";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const userId = await user_funGetOneUserId();
|
|
||||||
if (!userId) return <div>{"User Tidak ditemukan"}</div>;
|
|
||||||
const listStatus = await getStatusInvestasi();
|
const listStatus = await getStatusInvestasi();
|
||||||
const dataDraft = await getPortoByStatusId(userId, 1);
|
|
||||||
const dataReview = await getPortoByStatusId(userId, 2);
|
|
||||||
const dataPublish = await getPortoByStatusId(userId, 3);
|
|
||||||
const dataReject = await getPortoByStatusId(userId, 4);
|
|
||||||
|
|
||||||
const listDataPublish = await investasi_funGetAllPublishByUserId({ page: 1 });
|
const listDataPublish = await investasi_funGetAllPublishByUserId({ page: 1 });
|
||||||
const listDataReview = await investasi_funGetAllInvestasiNonPublishByUserId({
|
const listDataReview = await investasi_funGetAllInvestasiNonPublishByUserId({
|
||||||
@@ -38,13 +24,6 @@ export default async function Page() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* <PortofolioInvestasi
|
|
||||||
listStatusInvestasi={listStatusInvestasi as any}
|
|
||||||
dataDraft={dataDraft}
|
|
||||||
dataReview={dataReview}
|
|
||||||
dataPublish={dataPublish}
|
|
||||||
dataReject={dataReject}
|
|
||||||
/> */}
|
|
||||||
<Investasi_UiPortofolio
|
<Investasi_UiPortofolio
|
||||||
listStatus={listStatus}
|
listStatus={listStatus}
|
||||||
listDataPublish={listDataPublish}
|
listDataPublish={listDataPublish}
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
import getListAllTransaksiById_Investasi from "@/app_modules/investasi/fun/get_list_all_transaksi_by_id";
|
import getListAllTransaksiById_Investasi from "@/app_modules/investasi/fun/get_list_all_transaksi_by_id";
|
||||||
import getMaster_StatusTransaksiInvestasi from "@/app_modules/investasi/fun/master/get_status_transaksi";
|
import getMaster_StatusTransaksiInvestasi from "@/app_modules/investasi/fun/master/get_status_transaksi";
|
||||||
|
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { investasi_funGetTransaksiByUserId } from "@/app_modules/investasi/_fun";
|
import { investasi_funGetTransaksiByUserId } from "@/app_modules/investasi/_fun";
|
||||||
import { Investasi_UiDaftarTransaksi } from "@/app_modules/investasi/_ui";
|
import { Investasi_UiDaftarTransaksi } from "@/app_modules/investasi/_ui";
|
||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
const statusTransaksi = await getMaster_StatusTransaksiInvestasi();
|
const statusTransaksi = await getMaster_StatusTransaksiInvestasi();
|
||||||
const listTransaksi = await getListAllTransaksiById_Investasi(userLoginId);
|
const listTransaksi = await getListAllTransaksiById_Investasi(userLoginId);
|
||||||
|
|||||||
@@ -2,12 +2,10 @@ import { MetodeTransferInvestasi } from "@/app_modules/investasi";
|
|||||||
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
||||||
import getMaster_NamaBank from "@/app_modules/investasi/fun/master/get_nama_bank";
|
import getMaster_NamaBank from "@/app_modules/investasi/fun/master/get_nama_bank";
|
||||||
|
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
const dataInvestasi = await getOneInvestasiById(params.id);
|
const dataInvestasi = await getOneInvestasiById(params.id);
|
||||||
const namaBank = await getMaster_NamaBank();
|
const namaBank = await getMaster_NamaBank();
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global";
|
|
||||||
import { funGetUserProfile } from "@/app_modules/fun_global/get_user_profile";
|
import { funGetUserProfile } from "@/app_modules/fun_global/get_user_profile";
|
||||||
import { ProsesTransaksiInvestasi } from "@/app_modules/investasi";
|
import { ProsesTransaksiInvestasi } from "@/app_modules/investasi";
|
||||||
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
const userLogin = await funGetUserProfile(userLoginId);
|
const userLogin = await funGetUserProfile(userLoginId);
|
||||||
const dataInvestasi = await getOneInvestasiById(params.id);
|
const dataInvestasi = await getOneInvestasiById(params.id);
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import { KatalogLayout } from "@/app_modules/katalog/main";
|
import { KatalogLayout } from "@/app_modules/katalog/main";
|
||||||
import { Profile_getOneProfileAndUserById } from "@/app_modules/katalog/profile/fun/get/get_one_user_profile";
|
import { Profile_getOneProfileAndUserById } from "@/app_modules/katalog/profile/fun/get/get_one_user_profile";
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,15 @@
|
|||||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import { Katalog_MainView } from "@/app_modules/katalog";
|
import { Katalog_MainView } from "@/app_modules/katalog";
|
||||||
import { funGetListPortofolio } from "@/app_modules/katalog/portofolio/fun/get/get_list_portofolio";
|
import { funGetListPortofolio } from "@/app_modules/katalog/portofolio/fun/get/get_list_portofolio";
|
||||||
import { Profile_getOneProfileAndUserById } from "@/app_modules/katalog/profile/fun/get/get_one_user_profile";
|
import { Profile_getOneProfileAndUserById } from "@/app_modules/katalog/profile/fun/get/get_one_user_profile";
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
let profileId = params.id;
|
let profileId = params.id;
|
||||||
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const listPorto = await funGetListPortofolio(profileId);
|
const listPorto = await funGetListPortofolio(profileId);
|
||||||
const dataProfile = await Profile_getOneProfileAndUserById(profileId);
|
const dataProfile = await Profile_getOneProfileAndUserById(profileId);
|
||||||
|
|
||||||
const userLoginId = await funGetUserIdByToken();
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Katalog_MainView
|
<Katalog_MainView
|
||||||
|
|||||||
@@ -8,9 +8,6 @@ export default async function Layout({
|
|||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
// const cekCookies = await funCheckToken();
|
|
||||||
// if (cekCookies === false) redirect(RouterAuth.login);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<CheckCookies_UiLayout>{children}</CheckCookies_UiLayout>
|
<CheckCookies_UiLayout>{children}</CheckCookies_UiLayout>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import { PortofolioLayout } from "@/app_modules/katalog/portofolio";
|
import { PortofolioLayout } from "@/app_modules/katalog/portofolio";
|
||||||
import { portofolio_getOneById } from "@/app_modules/katalog/portofolio/fun/get/get_one_portofolio";
|
import { portofolio_getOneById } from "@/app_modules/katalog/portofolio/fun/get/get_one_portofolio";
|
||||||
|
|
||||||
@@ -12,8 +11,7 @@ export default async function Layout({
|
|||||||
}) {
|
}) {
|
||||||
let portoId = params.id;
|
let portoId = params.id;
|
||||||
const getPorto = await portofolio_getOneById(portoId);
|
const getPorto = await portofolio_getOneById(portoId);
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import { ViewPortofolio } from "@/app_modules/katalog/portofolio";
|
import { ViewPortofolio } from "@/app_modules/katalog/portofolio";
|
||||||
import { portofolio_getOneById } from "@/app_modules/katalog/portofolio/fun/get/get_one_portofolio";
|
import { portofolio_getOneById } from "@/app_modules/katalog/portofolio/fun/get/get_one_portofolio";
|
||||||
|
|
||||||
const mapboxToken = process.env.MAPBOX_TOKEN!;
|
const mapboxToken = process.env.MAPBOX_TOKEN!;
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
const getPorto = await portofolio_getOneById(params.id);
|
const getPorto = await portofolio_getOneById(params.id);
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { CreateProfile } from "@/app_modules/katalog/profile";
|
import { CreateProfile } from "@/app_modules/katalog/profile";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const userId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<CreateProfile userId={userId} />
|
<CreateProfile userLoginId={userLoginId} />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
import { RouterHome } from "@/app/lib/router_hipmi/router_home";
|
import { RouterHome } from "@/app/lib/router_hipmi/router_home";
|
||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import { Home_UserNonActive } from "@/app_modules/home";
|
import { Home_UserNonActive } from "@/app_modules/home";
|
||||||
import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id";
|
import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id";
|
||||||
import { redirect } from "next/navigation";
|
import { redirect } from "next/navigation";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
const dataUser = await user_getOneByUserId(userLoginId);
|
const dataUser = await user_getOneByUserId(userLoginId);
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global";
|
|
||||||
import { LayoutVote_DetailKontribusi } from "@/app_modules/vote";
|
import { LayoutVote_DetailKontribusi } from "@/app_modules/vote";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
@@ -11,9 +10,7 @@ export default async function Layout({
|
|||||||
params: { id: string };
|
params: { id: string };
|
||||||
}) {
|
}) {
|
||||||
const votingId = params.id;
|
const votingId = params.id;
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import { LayoutVote_MainDetail } from "@/app_modules/vote";
|
import { LayoutVote_MainDetail } from "@/app_modules/vote";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
@@ -11,8 +10,7 @@ export default async function Layout({
|
|||||||
params: { id: string };
|
params: { id: string };
|
||||||
}) {
|
}) {
|
||||||
const votingId = params.id;
|
const votingId = params.id;
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,17 +1,14 @@
|
|||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { Vote_MainDetail } from "@/app_modules/vote";
|
import { Vote_MainDetail } from "@/app_modules/vote";
|
||||||
import { Vote_cekKontributorById } from "@/app_modules/vote/fun/get/cek_kontributor_by_id";
|
import { Vote_cekKontributorById } from "@/app_modules/vote/fun/get/cek_kontributor_by_id";
|
||||||
|
import { voting_funGetOneVotingbyId } from "@/app_modules/vote/fun/get/fun_get_one_by_id";
|
||||||
import { Vote_getHasilVoteById } from "@/app_modules/vote/fun/get/get_list_hasil_by_id";
|
import { Vote_getHasilVoteById } from "@/app_modules/vote/fun/get/get_list_hasil_by_id";
|
||||||
import { Vote_getListKontributorById } from "@/app_modules/vote/fun/get/get_list_kontributor_by_id";
|
import { Vote_getListKontributorById } from "@/app_modules/vote/fun/get/get_list_kontributor_by_id";
|
||||||
import { voting_funGetOneVotingbyId } from "@/app_modules/vote/fun/get/fun_get_one_by_id";
|
|
||||||
import { Vote_getOnePilihanVotingByUserId } from "@/app_modules/vote/fun/get/get_one_pilihan_voting_by_user_id";
|
import { Vote_getOnePilihanVotingByUserId } from "@/app_modules/vote/fun/get/get_one_pilihan_voting_by_user_id";
|
||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
const voteId = params.id;
|
const voteId = params.id;
|
||||||
|
const userLoginId = await funGetUserIdByToken();
|
||||||
const userLoginId = await user_funGetOneUserId();
|
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
const dataVote = await voting_funGetOneVotingbyId(voteId);
|
const dataVote = await voting_funGetOneVotingbyId(voteId);
|
||||||
const hasilVoting = await Vote_getHasilVoteById(voteId as any);
|
const hasilVoting = await Vote_getHasilVoteById(voteId as any);
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global";
|
|
||||||
import { LayoutVote_DetailPublish } from "@/app_modules/vote";
|
import { LayoutVote_DetailPublish } from "@/app_modules/vote";
|
||||||
import { Voting_funGetOneVotingbyId } from "@/app_modules/vote/fun/get";
|
import { Voting_funGetOneVotingbyId } from "@/app_modules/vote/fun/get";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
@@ -12,11 +11,9 @@ export default async function Layout({
|
|||||||
params: { id: string };
|
params: { id: string };
|
||||||
}) {
|
}) {
|
||||||
const votingId = params.id;
|
const votingId = params.id;
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
|
||||||
|
|
||||||
const dataVoting = await Voting_funGetOneVotingbyId(votingId);
|
const dataVoting = await Voting_funGetOneVotingbyId(votingId);
|
||||||
const authorId = dataVoting?.authorId;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global";
|
|
||||||
import { LayoutVote_DetailSemuaRiwayat } from "@/app_modules/vote";
|
import { LayoutVote_DetailSemuaRiwayat } from "@/app_modules/vote";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
@@ -11,7 +11,8 @@ export default async function Layout({
|
|||||||
params: { id: string };
|
params: { id: string };
|
||||||
}) {
|
}) {
|
||||||
const votingId = params.id;
|
const votingId = params.id;
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
if (!userLoginId) return <CheckCookies_UiView />;
|
if (!userLoginId) return <CheckCookies_UiView />;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
24
src/app_modules/_global/component/comp_box_upload_image.tsx
Normal file
24
src/app_modules/_global/component/comp_box_upload_image.tsx
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
|
||||||
|
import { Box } from "@mantine/core";
|
||||||
|
|
||||||
|
export function ComponentGlobal_BoxUploadImage({
|
||||||
|
children,
|
||||||
|
}: {
|
||||||
|
children: React.ReactNode;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<ComponentGlobal_CardStyles height={300}>
|
||||||
|
<Box
|
||||||
|
style={{
|
||||||
|
height: "100%",
|
||||||
|
borderStyle: "dashed",
|
||||||
|
borderRadius: "5px",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</Box>
|
||||||
|
</ComponentGlobal_CardStyles>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import ComponentGlobal_BoxInformation from "./box_information";
|
import ComponentGlobal_BoxInformation from "./box_information";
|
||||||
import ComponentGlobal_AvatarAndAuthorName from "./comp_author_name_and_avatar";
|
import ComponentGlobal_AvatarAndAuthorName from "./comp_author_name_and_avatar";
|
||||||
|
import { ComponentGlobal_BoxUploadImage } from "./comp_box_upload_image";
|
||||||
import { ComponentGlobal_CardStyles } from "./comp_card_box_and_background";
|
import { ComponentGlobal_CardStyles } from "./comp_card_box_and_background";
|
||||||
import ComponentGlobal_CardLoadingOverlay from "./comp_loading_card";
|
import ComponentGlobal_CardLoadingOverlay from "./comp_loading_card";
|
||||||
import ComponentGlobal_TampilanAngkaRatusan from "./comp_tampilan_angka_ratusan";
|
import ComponentGlobal_TampilanAngkaRatusan from "./comp_tampilan_angka_ratusan";
|
||||||
@@ -13,3 +14,4 @@ export { ComponentGlobal_CardLoadingOverlay };
|
|||||||
export { ComponentGlobal_BoxInformation };
|
export { ComponentGlobal_BoxInformation };
|
||||||
export { ComponentGlobal_InputCountDown };
|
export { ComponentGlobal_InputCountDown };
|
||||||
export { ComponentGlobal_CardStyles };
|
export { ComponentGlobal_CardStyles };
|
||||||
|
export { ComponentGlobal_BoxUploadImage };
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export default function Admin_Logout() {
|
|||||||
const [loadingLogout, setLoadingLogout] = useState(false);
|
const [loadingLogout, setLoadingLogout] = useState(false);
|
||||||
|
|
||||||
async function onClickLogout() {
|
async function onClickLogout() {
|
||||||
await auth_Logout(kodeId).then((res) => {
|
await auth_Logout().then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
setLoadingLogout(true);
|
setLoadingLogout(true);
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
|
|||||||
@@ -2,10 +2,8 @@
|
|||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { RouterAdminColab } from "@/app/lib/router_admin/router_admin_colab";
|
import { RouterAdminColab } from "@/app/lib/router_admin/router_admin_colab";
|
||||||
import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import { revalidatePath } from "next/cache";
|
import { revalidatePath } from "next/cache";
|
||||||
import { redirect } from "next/navigation";
|
|
||||||
|
|
||||||
export default async function adminColab_funReportProjectById({
|
export default async function adminColab_funReportProjectById({
|
||||||
colabId,
|
colabId,
|
||||||
@@ -14,11 +12,7 @@ export default async function adminColab_funReportProjectById({
|
|||||||
colabId: string;
|
colabId: string;
|
||||||
report: string;
|
report: string;
|
||||||
}) {
|
}) {
|
||||||
const authorId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!authorId) {
|
|
||||||
redirect(RouterAuth.login);
|
|
||||||
// return { status: 400, message: "Gagal mendapatkan authorId" };
|
|
||||||
}
|
|
||||||
|
|
||||||
const projectUpdate = await prisma.projectCollaboration.update({
|
const projectUpdate = await prisma.projectCollaboration.update({
|
||||||
where: {
|
where: {
|
||||||
@@ -39,7 +33,7 @@ export default async function adminColab_funReportProjectById({
|
|||||||
const updateReport = await prisma.projectCollaboration_Notifikasi.create({
|
const updateReport = await prisma.projectCollaboration_Notifikasi.create({
|
||||||
data: {
|
data: {
|
||||||
projectCollaborationId: colabId,
|
projectCollaborationId: colabId,
|
||||||
adminId: authorId,
|
adminId: userLoginId,
|
||||||
userId: projectUpdate.userId as any,
|
userId: projectUpdate.userId as any,
|
||||||
note: "Project Anda Telah Direport Admin",
|
note: "Project Anda Telah Direport Admin",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -353,6 +353,11 @@ async function onPublish({
|
|||||||
"USER",
|
"USER",
|
||||||
JSON.stringify({ userId: publish?.data?.authorId, count: 1 })
|
JSON.stringify({ userId: publish?.data?.authorId, count: 1 })
|
||||||
);
|
);
|
||||||
|
|
||||||
|
mqtt_client.publish(
|
||||||
|
"Job_new_post",
|
||||||
|
JSON.stringify({ isNewPost: true, count: 1 })
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
ComponentGlobal_NotifikasiBerhasil(publish.message);
|
ComponentGlobal_NotifikasiBerhasil(publish.message);
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
|
|
||||||
export default async function adminNotifikasi_countNotifikasi() {
|
export default async function adminNotifikasi_countNotifikasi() {
|
||||||
const adminId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const data = await prisma.notifikasi.findMany({
|
const data = await prisma.notifikasi.findMany({
|
||||||
where: {
|
where: {
|
||||||
adminId: adminId,
|
adminId: userLoginId,
|
||||||
isRead: false,
|
isRead: false,
|
||||||
userRoleId: "2",
|
userRoleId: "2",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
|
import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
|
||||||
|
|
||||||
export default async function adminNotifikasi_funCreateToUser({
|
export default async function adminNotifikasi_funCreateToUser({
|
||||||
@@ -9,11 +9,11 @@ export default async function adminNotifikasi_funCreateToUser({
|
|||||||
}: {
|
}: {
|
||||||
data: MODEL_NOTIFIKASI;
|
data: MODEL_NOTIFIKASI;
|
||||||
}) {
|
}) {
|
||||||
const adminId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const create = await prisma.notifikasi.create({
|
const create = await prisma.notifikasi.create({
|
||||||
data: {
|
data: {
|
||||||
adminId: adminId,
|
adminId: userLoginId,
|
||||||
userId: data.userId,
|
userId: data.userId,
|
||||||
appId: data.appId,
|
appId: data.appId,
|
||||||
status: data.status,
|
status: data.status,
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { NextRequest } from "next/server";
|
|
||||||
|
|
||||||
export default async function adminNotifikasi_getByUserId() {
|
export default async function adminNotifikasi_getByUserId() {
|
||||||
const adminId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const data = await prisma.notifikasi.findMany({
|
const data = await prisma.notifikasi.findMany({
|
||||||
orderBy: [
|
orderBy: [
|
||||||
@@ -17,7 +16,7 @@ export default async function adminNotifikasi_getByUserId() {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
where: {
|
where: {
|
||||||
adminId: adminId,
|
adminId: userLoginId,
|
||||||
userRoleId: "2",
|
userRoleId: "2",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export async function auth_funLogin({ nomor }: { nomor: string }) {
|
|||||||
|
|
||||||
const sendWa = await res.json();
|
const sendWa = await res.json();
|
||||||
if (sendWa.status !== "success")
|
if (sendWa.status !== "success")
|
||||||
return { status: 400, message: "WA Tidak Terdaftar", nomorUser: {} };
|
return { status: 400, message: "WA Tidak Terdaftar", kodeId: {} };
|
||||||
|
|
||||||
const createOtpId = await prisma.kodeOtp.create({
|
const createOtpId = await prisma.kodeOtp.create({
|
||||||
data: {
|
data: {
|
||||||
@@ -27,15 +27,15 @@ export async function auth_funLogin({ nomor }: { nomor: string }) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!createOtpId)
|
if (!createOtpId)
|
||||||
return { status: 400, message: "Gagal Membuat Kode OTP", nomorUser: {} };
|
return { status: 400, message: "Gagal Membuat Kode OTP", kodeId: {} };
|
||||||
|
|
||||||
return {
|
return {
|
||||||
status: 200,
|
status: 200,
|
||||||
message: "Kode Verifikasi Dikirim",
|
message: "Kode Verifikasi Dikirim",
|
||||||
nomorUser: nomor,
|
kodeId: createOtpId.id,
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
return { status: 500, message: "Server Error !!!", nomorUser: {} };
|
return { status: 500, message: "Server Error !!!", kodeId: {} };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
|||||||
import { revalidatePath } from "next/cache";
|
import { revalidatePath } from "next/cache";
|
||||||
import { cookies } from "next/headers";
|
import { cookies } from "next/headers";
|
||||||
|
|
||||||
export async function auth_Logout(kodeId: string) {
|
export async function auth_Logout() {
|
||||||
const userId = await funGetUserIdByToken();
|
const userId = await funGetUserIdByToken();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -19,8 +19,7 @@ export async function auth_Logout(kodeId: string) {
|
|||||||
cookies().set({
|
cookies().set({
|
||||||
name: "ssn",
|
name: "ssn",
|
||||||
value: "",
|
value: "",
|
||||||
maxAge: 0,
|
|
||||||
expires: 0,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return { status: 200, message: "Logout Berhasil" };
|
return { status: 200, message: "Logout Berhasil" };
|
||||||
@@ -28,12 +27,6 @@ export async function auth_Logout(kodeId: string) {
|
|||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
// const del = await prisma.kodeOtp.delete({
|
revalidatePath("/");
|
||||||
// where: {
|
|
||||||
// id: kodeId,
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
// if (!del) return { status: 400, message: "Gagal Hapus Kode OTP Id"};
|
|
||||||
// revalidatePath("/dev/katalog")
|
|
||||||
return { status: 200, message: "Logout Berhasil" };
|
return { status: 200, message: "Logout Berhasil" };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import { RouterHome } from "@/app/lib/router_hipmi/router_home";
|
||||||
import { sealData } from "iron-session";
|
import { sealData } from "iron-session";
|
||||||
|
import { revalidatePath } from "next/cache";
|
||||||
import { cookies } from "next/headers";
|
import { cookies } from "next/headers";
|
||||||
|
|
||||||
export async function Auth_funRegister({
|
export async function Auth_funRegister({
|
||||||
@@ -47,15 +49,20 @@ export async function Auth_funRegister({
|
|||||||
// maxAge: 60 * 60 * 24 * 7,
|
// maxAge: 60 * 60 * 24 * 7,
|
||||||
});
|
});
|
||||||
|
|
||||||
const createUserSession = await prisma.userSession.create({
|
try {
|
||||||
data: {
|
const createUserSession = await prisma.userSession.create({
|
||||||
token: sealToken,
|
data: {
|
||||||
userId: create.id,
|
token: sealToken,
|
||||||
},
|
userId: create.id,
|
||||||
});
|
},
|
||||||
|
});
|
||||||
|
|
||||||
if (!createUserSession)
|
if (!createUserSession)
|
||||||
return { status: 400, message: "Gagal Membuat User Session" };
|
return { status: 401, message: "Gagal Membuat User Session" };
|
||||||
|
|
||||||
|
revalidatePath(RouterHome.main_home);
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
return { status: 200, message: "Berhasil Mendaftar" };
|
return { status: 200, message: "Berhasil Mendaftar" };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ export async function auth_funValidasi({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (cekUser === null) return { status: 400, message: "Nomor Belum Terdaftar" };
|
if (cekUser === null)
|
||||||
|
return { status: 400, message: "Nomor Belum Terdaftar", role: {} };
|
||||||
|
|
||||||
const sealToken = await sealData(
|
const sealToken = await sealData(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
@@ -40,10 +41,23 @@ export async function auth_funValidasi({
|
|||||||
cookies().set({
|
cookies().set({
|
||||||
name: "ssn",
|
name: "ssn",
|
||||||
value: sealToken,
|
value: sealToken,
|
||||||
// maxAge: 60 * 60 * 24 * 30,
|
maxAge: 60 * 60 * 24 * 30,
|
||||||
// expires: 60 * 60 * 24 * 30,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const cekSessionUser = await prisma.userSession.findFirst({
|
||||||
|
where: {
|
||||||
|
userId: cekUser.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (cekSessionUser !== null) {
|
||||||
|
await prisma.userSession.delete({
|
||||||
|
where: {
|
||||||
|
userId: cekUser.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const createUserSession = await prisma.userSession.create({
|
const createUserSession = await prisma.userSession.create({
|
||||||
data: {
|
data: {
|
||||||
@@ -53,7 +67,7 @@ export async function auth_funValidasi({
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!createUserSession)
|
if (!createUserSession)
|
||||||
return { status: 401, message: "Gagal Membuat User Session" };
|
return { status: 401, message: "Gagal Membuat User Session", role: {} };
|
||||||
|
|
||||||
revalidatePath(RouterHome.main_home);
|
revalidatePath(RouterHome.main_home);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
|
|
||||||
export async function auth_getKodeOtpById({nomor}: {nomor: string}) {
|
export async function auth_getCodeOtpByNumber({kodeId}: {kodeId: string}) {
|
||||||
const data = await prisma.kodeOtp.findFirst({
|
const data = await prisma.kodeOtp.findFirst({
|
||||||
where: {
|
where: {
|
||||||
nomor: nomor,
|
id: kodeId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ import {
|
|||||||
|
|
||||||
export default function Login() {
|
export default function Login() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [kodeId, setKodeId] = useAtom(gs_kodeId);
|
|
||||||
const [phone, setPhone] = useState("");
|
const [phone, setPhone] = useState("");
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [isError, setError] = useState(false);
|
const [isError, setError] = useState(false);
|
||||||
@@ -41,7 +40,7 @@ export default function Login() {
|
|||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
|
ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
|
||||||
router.push(RouterAuth.validasi + res.nomorUser, { scroll: false });
|
router.push(RouterAuth.validasi + res.kodeId, { scroll: false });
|
||||||
} else {
|
} else {
|
||||||
ComponentGlobal_NotifikasiPeringatan(res.message);
|
ComponentGlobal_NotifikasiPeringatan(res.message);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,23 +6,19 @@ import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/noti
|
|||||||
import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
|
import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
|
||||||
import { ActionIcon, Button, Stack, Text } from "@mantine/core";
|
import { ActionIcon, Button, Stack, Text } from "@mantine/core";
|
||||||
import { IconLogout } from "@tabler/icons-react";
|
import { IconLogout } from "@tabler/icons-react";
|
||||||
import { useAtom } from "jotai";
|
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { auth_Logout } from "../fun/fun_logout";
|
import { auth_Logout } from "../fun/fun_logout";
|
||||||
import { gs_kodeId } from "../state/state";
|
|
||||||
|
|
||||||
export default function Component_Logout() {
|
export default function Component_Logout() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [opened, setOpened] = useState(false);
|
const [opened, setOpened] = useState(false);
|
||||||
const [kodeId, setKodeId] = useAtom(gs_kodeId);
|
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
async function onClickLogout() {
|
async function onClickLogout() {
|
||||||
await auth_Logout(kodeId).then((res) => {
|
await auth_Logout().then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
setKodeId("");
|
|
||||||
} else {
|
} else {
|
||||||
ComponentGlobal_NotifikasiPeringatan(res.message);
|
ComponentGlobal_NotifikasiPeringatan(res.message);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,10 +61,20 @@ export default function Validasi({ dataOtp }: { dataOtp: any }) {
|
|||||||
} else {
|
} else {
|
||||||
ComponentGlobal_NotifikasiPeringatan(resAktivasi.message);
|
ComponentGlobal_NotifikasiPeringatan(resAktivasi.message);
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
if (res.status === 400) {
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
router.push(RouterAuth.register + dataOtp.id, { scroll: false });
|
router.push(RouterAuth.register + dataOtp.id, { scroll: false });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (res.status === 401) {
|
||||||
|
const resAktivasi = await auth_funDeleteAktivasiKodeOtpById(dataOtp.id);
|
||||||
|
if (resAktivasi.status === 200) {
|
||||||
|
ComponentGlobal_NotifikasiPeringatan(res.message);
|
||||||
|
router.push(RouterAuth.login, { scroll: false });
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -12,16 +12,16 @@ export function CheckCookies_UiLayout({
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
useShallowEffect(() => {
|
useShallowEffect(() => {
|
||||||
// onCheckCookies();
|
onCheckCookies();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// async function onCheckCookies() {
|
async function onCheckCookies() {
|
||||||
// const cek = await fetch("/api/check-cookies");
|
const cek = await fetch("/api/check-cookies");
|
||||||
// const result = await cek.json();
|
const result = await cek.json();
|
||||||
// if (result.success === false) {
|
if (result.success === false) {
|
||||||
// router.push(RouterAuth.login);
|
router.push(RouterAuth.login);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
return <>{children}</>;
|
return <>{children}</>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { MODEL_COLLABORATION } from "../../model/interface";
|
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import { revalidatePath } from "next/cache";
|
|
||||||
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
||||||
import _ from "lodash";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
|
import { revalidatePath } from "next/cache";
|
||||||
|
import { MODEL_COLLABORATION } from "../../model/interface";
|
||||||
|
|
||||||
export default async function colab_funCreateProyek(
|
export default async function colab_funCreateProyek(
|
||||||
value: MODEL_COLLABORATION
|
value: MODEL_COLLABORATION
|
||||||
) {
|
) {
|
||||||
const AuthorId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const data = await prisma.projectCollaboration.create({
|
const data = await prisma.projectCollaboration.create({
|
||||||
data: {
|
data: {
|
||||||
@@ -20,7 +19,7 @@ export default async function colab_funCreateProyek(
|
|||||||
benefit: value.benefit,
|
benefit: value.benefit,
|
||||||
projectCollaborationMaster_IndustriId:
|
projectCollaborationMaster_IndustriId:
|
||||||
value.projectCollaborationMaster_IndustriId,
|
value.projectCollaborationMaster_IndustriId,
|
||||||
userId: AuthorId,
|
userId: userLoginId,
|
||||||
// jumlah_partisipan: + value.jumlah_partisipan,
|
// jumlah_partisipan: + value.jumlah_partisipan,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,25 +1,19 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import { redirect } from "next/navigation";
|
|
||||||
|
|
||||||
export default async function colab_funCreateRoomChat(
|
export default async function colab_funCreateRoomChat(
|
||||||
nameRoom: string,
|
nameRoom: string,
|
||||||
value: any[],
|
value: any[],
|
||||||
colabId: string
|
colabId: string
|
||||||
) {
|
) {
|
||||||
const authorId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!authorId) {
|
|
||||||
redirect(RouterAuth.login);
|
|
||||||
// return { status: 400, message: "Gagal mendapatkan authorId" };
|
|
||||||
}
|
|
||||||
|
|
||||||
const createRoom = await prisma.projectCollaboration_RoomChat.create({
|
const createRoom = await prisma.projectCollaboration_RoomChat.create({
|
||||||
data: {
|
data: {
|
||||||
name: nameRoom,
|
name: nameRoom,
|
||||||
userId: authorId,
|
userId: userLoginId,
|
||||||
projectCollaborationId: colabId,
|
projectCollaborationId: colabId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -57,7 +51,7 @@ export default async function colab_funCreateRoomChat(
|
|||||||
const createForAuthor =
|
const createForAuthor =
|
||||||
await prisma.projectCollaboration_AnggotaRoomChat.create({
|
await prisma.projectCollaboration_AnggotaRoomChat.create({
|
||||||
data: {
|
data: {
|
||||||
userId: authorId,
|
userId: userLoginId,
|
||||||
projectCollaboration_RoomChatId: createRoom.id,
|
projectCollaboration_RoomChatId: createRoom.id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,14 +2,15 @@
|
|||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { revalidatePath } from "next/cache";
|
import { revalidatePath } from "next/cache";
|
||||||
|
|
||||||
export default async function colab_funCreateMessageByUserId(
|
export default async function colab_funCreateMessageByUserId(
|
||||||
message: string,
|
message: string,
|
||||||
roomId: string
|
roomId: string
|
||||||
) {
|
) {
|
||||||
const userLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const msg = await prisma.projectCollaboration_Message.create({
|
const msg = await prisma.projectCollaboration_Message.create({
|
||||||
data: {
|
data: {
|
||||||
userId: userLoginId,
|
userId: userLoginId,
|
||||||
|
|||||||
@@ -1,20 +1,14 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import { redirect } from "next/navigation";
|
|
||||||
|
|
||||||
export default async function colab_CekNotifikasi() {
|
export default async function colab_CekNotifikasi() {
|
||||||
const authorId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!authorId) {
|
|
||||||
redirect(RouterAuth.login);
|
|
||||||
// return { status: 400, message: "Gagal mendapatkan authorId" };
|
|
||||||
}
|
|
||||||
|
|
||||||
const cekNotif = await prisma.projectCollaboration_Notifikasi.findMany({
|
const cekNotif = await prisma.projectCollaboration_Notifikasi.findMany({
|
||||||
where: {
|
where: {
|
||||||
userId: authorId,
|
userId: userLoginId,
|
||||||
isRead: false,
|
isRead: false,
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
|
|||||||
@@ -1,22 +1,21 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
|
|
||||||
export default async function colab_funCekPartisipasiById(colabId: string) {
|
export default async function colab_funCekPartisipasiById(colabId: string) {
|
||||||
const UserLoginId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const cek = await prisma.projectCollaboration_Partisipasi.findFirst({
|
const cek = await prisma.projectCollaboration_Partisipasi.findFirst({
|
||||||
where: {
|
where: {
|
||||||
projectCollaborationId: colabId,
|
projectCollaborationId: colabId,
|
||||||
userId: UserLoginId,
|
userId: userLoginId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
if (cek === null) {
|
if (cek === null) {
|
||||||
return (false);
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return (true);
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
|
|
||||||
export default async function colab_getListByStatusId(statusId: number) {
|
export default async function colab_getListByStatusId(statusId: number) {
|
||||||
const AuthorId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const data = await prisma.projectCollaboration.findMany({
|
const data = await prisma.projectCollaboration.findMany({
|
||||||
where: {
|
where: {
|
||||||
userId: AuthorId,
|
userId: userLoginId,
|
||||||
projectCollaborationMaster_StatusId: statusId,
|
projectCollaborationMaster_StatusId: statusId,
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
|
|||||||
@@ -1,26 +1,20 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import { redirect } from "next/navigation";
|
|
||||||
|
|
||||||
export default async function colab_getListNotifikasiByUserId() {
|
export default async function colab_getListNotifikasiByUserId() {
|
||||||
const authorId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!authorId) {
|
|
||||||
redirect(RouterAuth.login);
|
|
||||||
// return { status: 400, message: "Gagal mendapatkan authorId" };
|
|
||||||
}
|
|
||||||
|
|
||||||
const get = await prisma.projectCollaboration_Notifikasi.findMany({
|
const get = await prisma.projectCollaboration_Notifikasi.findMany({
|
||||||
orderBy: {
|
orderBy: {
|
||||||
createdAt: "desc",
|
createdAt: "desc",
|
||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
userId: authorId,
|
userId: userLoginId,
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
id:true,
|
id: true,
|
||||||
createdAt: true,
|
createdAt: true,
|
||||||
isRead: true,
|
isRead: true,
|
||||||
note: true,
|
note: true,
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
|
|
||||||
export default async function colab_getListPartisipasiProyekByAuthorId({
|
export default async function colab_getListPartisipasiProyekByAuthorId({
|
||||||
page,
|
page,
|
||||||
}: {
|
}: {
|
||||||
page: number;
|
page: number;
|
||||||
}) {
|
}) {
|
||||||
const authorId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const takeData = 5;
|
const takeData = 5;
|
||||||
const skipData = page * takeData - takeData;
|
const skipData = page * takeData - takeData;
|
||||||
@@ -20,7 +20,7 @@ export default async function colab_getListPartisipasiProyekByAuthorId({
|
|||||||
createdAt: "desc",
|
createdAt: "desc",
|
||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
userId: authorId,
|
userId: userLoginId,
|
||||||
isActive: true,
|
isActive: true,
|
||||||
AND: {
|
AND: {
|
||||||
ProjectCollaboration: {
|
ProjectCollaboration: {
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
|
|
||||||
export default async function colab_getListAllProyekSayaByAuthorId({
|
export default async function colab_getListAllProyekSayaByAuthorId({
|
||||||
page,
|
page,
|
||||||
}: {
|
}: {
|
||||||
page: number;
|
page: number;
|
||||||
}) {
|
}) {
|
||||||
const authorId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const takeData = 5;
|
const takeData = 5;
|
||||||
const skipData = page * takeData - takeData;
|
const skipData = page * takeData - takeData;
|
||||||
@@ -17,7 +17,7 @@ export default async function colab_getListAllProyekSayaByAuthorId({
|
|||||||
take: takeData,
|
take: takeData,
|
||||||
skip: skipData,
|
skip: skipData,
|
||||||
orderBy: { createdAt: "desc" },
|
orderBy: { createdAt: "desc" },
|
||||||
where: { userId: authorId, isActive: true },
|
where: { userId: userLoginId, isActive: true },
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
isActive: true,
|
isActive: true,
|
||||||
|
|||||||
@@ -1,20 +1,15 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import { redirect } from "next/navigation";
|
|
||||||
|
|
||||||
export default async function colab_getListRoomChatByAuthorId({
|
export default async function colab_getListRoomChatByAuthorId({
|
||||||
page,
|
page,
|
||||||
}: {
|
}: {
|
||||||
page: number;
|
page: number;
|
||||||
}) {
|
}) {
|
||||||
const authorId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
if (!authorId) {
|
|
||||||
redirect(RouterAuth.login);
|
|
||||||
// return { status: 400, message: "Gagal mendapatkan authorId" };
|
|
||||||
}
|
|
||||||
const takeData = 10;
|
const takeData = 10;
|
||||||
const skipData = page * takeData - takeData;
|
const skipData = page * takeData - takeData;
|
||||||
|
|
||||||
@@ -25,7 +20,7 @@ export default async function colab_getListRoomChatByAuthorId({
|
|||||||
createdAt: "desc",
|
createdAt: "desc",
|
||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
userId: authorId,
|
userId: userLoginId,
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
ProjectCollaboration_RoomChat: {
|
ProjectCollaboration_RoomChat: {
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
|
|
||||||
export async function donasi_funGetAllInvoiceByAuthorId({
|
export async function donasi_funGetAllInvoiceByAuthorId({
|
||||||
page,
|
page,
|
||||||
}: {
|
}: {
|
||||||
page: number;
|
page: number;
|
||||||
}) {
|
}) {
|
||||||
const authorId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const takeData = 5;
|
const takeData = 5;
|
||||||
const skipData = page * takeData - takeData;
|
const skipData = page * takeData - takeData;
|
||||||
|
|
||||||
@@ -19,7 +20,7 @@ export async function donasi_funGetAllInvoiceByAuthorId({
|
|||||||
createdAt: "desc",
|
createdAt: "desc",
|
||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
authorId: authorId,
|
authorId: userLoginId,
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
|
|
||||||
export async function donasi_funGetAllStatusDraft({ page }: { page: number }) {
|
export async function donasi_funGetAllStatusDraft({ page }: { page: number }) {
|
||||||
const authorId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const takeData = 5;
|
const takeData = 5;
|
||||||
const skipData = page * takeData - takeData;
|
const skipData = page * takeData - takeData;
|
||||||
|
|
||||||
@@ -15,10 +16,10 @@ export async function donasi_funGetAllStatusDraft({ page }: { page: number }) {
|
|||||||
updatedAt: "desc",
|
updatedAt: "desc",
|
||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
authorId: authorId,
|
authorId: userLoginId,
|
||||||
donasiMaster_StatusDonasiId: "3",
|
donasiMaster_StatusDonasiId: "3",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,18 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
|
|
||||||
|
export async function donasi_funGetAllStatusPublish({
|
||||||
|
page,
|
||||||
|
}: {
|
||||||
|
page: number;
|
||||||
|
}) {
|
||||||
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
export async function donasi_funGetAllStatusPublish({ page }: { page: number }) {
|
|
||||||
const authorId = await user_funGetOneUserId();
|
|
||||||
const takeData = 5;
|
const takeData = 5;
|
||||||
const skipData = page * takeData - takeData;
|
const skipData = page * takeData - takeData;
|
||||||
|
|
||||||
|
|
||||||
const data = await prisma.donasi.findMany({
|
const data = await prisma.donasi.findMany({
|
||||||
take: takeData,
|
take: takeData,
|
||||||
skip: skipData,
|
skip: skipData,
|
||||||
@@ -16,7 +20,7 @@ export async function donasi_funGetAllStatusPublish({ page }: { page: number })
|
|||||||
publishTime: "desc",
|
publishTime: "desc",
|
||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
authorId: authorId,
|
authorId: userLoginId,
|
||||||
donasiMaster_StatusDonasiId: "1",
|
donasiMaster_StatusDonasiId: "1",
|
||||||
active: true,
|
active: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
|
|
||||||
export async function donasi_funGetAllStatusReject({ page }: { page: number }) {
|
export async function donasi_funGetAllStatusReject({ page }: { page: number }) {
|
||||||
const authorId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const takeData = 5;
|
const takeData = 5;
|
||||||
const skipData = page * takeData - takeData;
|
const skipData = page * takeData - takeData;
|
||||||
|
|
||||||
@@ -15,7 +16,7 @@ export async function donasi_funGetAllStatusReject({ page }: { page: number }) {
|
|||||||
updatedAt: "desc",
|
updatedAt: "desc",
|
||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
authorId: authorId,
|
authorId: userLoginId,
|
||||||
donasiMaster_StatusDonasiId: "4",
|
donasiMaster_StatusDonasiId: "4",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,24 +1,25 @@
|
|||||||
"use server"
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
|
|
||||||
export async function donasi_funGetAllStatusReview({page}: {page: number}) {
|
export async function donasi_funGetAllStatusReview({ page }: { page: number }) {
|
||||||
const authorId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
const takeData = 5;
|
|
||||||
const skipData = page * takeData - takeData;
|
|
||||||
|
|
||||||
const data = await prisma.donasi.findMany({
|
const takeData = 5;
|
||||||
take: takeData,
|
const skipData = page * takeData - takeData;
|
||||||
skip: skipData,
|
|
||||||
orderBy: {
|
|
||||||
updatedAt: "desc",
|
|
||||||
},
|
|
||||||
where: {
|
|
||||||
authorId: authorId,
|
|
||||||
donasiMaster_StatusDonasiId: "2",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
return data;
|
const data = await prisma.donasi.findMany({
|
||||||
}
|
take: takeData,
|
||||||
|
skip: skipData,
|
||||||
|
orderBy: {
|
||||||
|
updatedAt: "desc",
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
authorId: userLoginId,
|
||||||
|
donasiMaster_StatusDonasiId: "2",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
|
|
||||||
export async function event_getListKontibusiByUserId({page}: {page: number}) {
|
export async function event_getListKontibusiByUserId({
|
||||||
const userLoginId = await user_funGetOneUserId();
|
page,
|
||||||
|
}: {
|
||||||
|
page: number;
|
||||||
|
}) {
|
||||||
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const takeData = 10;
|
const takeData = 10;
|
||||||
const skipData = page * takeData - takeData;
|
const skipData = page * takeData - takeData;
|
||||||
@@ -41,8 +45,8 @@ export async function event_getListKontibusiByUserId({page}: {page: number}) {
|
|||||||
userId: true,
|
userId: true,
|
||||||
User: {
|
User: {
|
||||||
select: {
|
select: {
|
||||||
Profile: true
|
Profile: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -50,7 +54,7 @@ export async function event_getListKontibusiByUserId({page}: {page: number}) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
// console.log(data);
|
// console.log(data);
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import _ from "lodash";
|
|
||||||
|
|
||||||
export async function event_getListRiwayatSaya({page}: {page: number}) {
|
export async function event_getListRiwayatSaya({ page }: { page: number }) {
|
||||||
const authorId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const takeData = 10;
|
const takeData = 10;
|
||||||
const skipData = page * takeData - takeData;
|
const skipData = page * takeData - takeData;
|
||||||
|
|
||||||
|
|
||||||
const data = await prisma.event.findMany({
|
const data = await prisma.event.findMany({
|
||||||
take: takeData,
|
take: takeData,
|
||||||
skip: skipData,
|
skip: skipData,
|
||||||
@@ -18,7 +16,7 @@ export async function event_getListRiwayatSaya({page}: {page: number}) {
|
|||||||
tanggal: "desc",
|
tanggal: "desc",
|
||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
authorId: authorId,
|
authorId: userLoginId,
|
||||||
eventMaster_StatusId: "1",
|
eventMaster_StatusId: "1",
|
||||||
tanggal: {
|
tanggal: {
|
||||||
lte: new Date(),
|
lte: new Date(),
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
|
|
||||||
export async function event_getAllDraft({ page }: { page: number }) {
|
export async function event_getAllDraft({ page }: { page: number }) {
|
||||||
const authorId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const takeData = 10;
|
const takeData = 10;
|
||||||
const skipData = page * takeData - takeData;
|
const skipData = page * takeData - takeData;
|
||||||
|
|
||||||
@@ -17,7 +18,7 @@ export async function event_getAllDraft({ page }: { page: number }) {
|
|||||||
where: {
|
where: {
|
||||||
active: true,
|
active: true,
|
||||||
eventMaster_StatusId: "3",
|
eventMaster_StatusId: "3",
|
||||||
authorId: authorId,
|
authorId: userLoginId,
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
|
|
||||||
export async function event_getAllReject({ page }: { page: number }) {
|
export async function event_getAllReject({ page }: { page: number }) {
|
||||||
const authorId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const takeData = 10;
|
const takeData = 10;
|
||||||
const skipData = page * takeData - takeData;
|
const skipData = page * takeData - takeData;
|
||||||
|
|
||||||
@@ -17,7 +18,7 @@ export async function event_getAllReject({ page }: { page: number }) {
|
|||||||
where: {
|
where: {
|
||||||
active: true,
|
active: true,
|
||||||
eventMaster_StatusId: "4",
|
eventMaster_StatusId: "4",
|
||||||
authorId: authorId,
|
authorId: userLoginId,
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
|
|
||||||
export async function event_getAllReview({ page }: { page: number }) {
|
export async function event_getAllReview({ page }: { page: number }) {
|
||||||
const authorId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const takeData = 10;
|
const takeData = 10;
|
||||||
const skipData = page * takeData - takeData;
|
const skipData = page * takeData - takeData;
|
||||||
|
|
||||||
@@ -17,7 +18,7 @@ export async function event_getAllReview({ page }: { page: number }) {
|
|||||||
where: {
|
where: {
|
||||||
active: true,
|
active: true,
|
||||||
eventMaster_StatusId: "2",
|
eventMaster_StatusId: "2",
|
||||||
authorId: authorId,
|
authorId: userLoginId,
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
|
|
||||||
export async function event_funGetAllStatusPublish({ page }: { page: number }) {
|
export async function event_funGetAllStatusPublish({ page }: { page: number }) {
|
||||||
const authorId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const takeData = 10;
|
const takeData = 10;
|
||||||
const skipData = page * takeData - takeData;
|
const skipData = page * takeData - takeData;
|
||||||
|
|
||||||
@@ -17,7 +18,7 @@ export async function event_funGetAllStatusPublish({ page }: { page: number }) {
|
|||||||
where: {
|
where: {
|
||||||
active: true,
|
active: true,
|
||||||
eventMaster_StatusId: "1",
|
eventMaster_StatusId: "1",
|
||||||
authorId: authorId,
|
authorId: userLoginId,
|
||||||
tanggal: {
|
tanggal: {
|
||||||
gte: new Date(),
|
gte: new Date(),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,38 +3,30 @@
|
|||||||
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
|
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
|
||||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||||
import {
|
import {
|
||||||
Drawer,
|
|
||||||
Stack,
|
|
||||||
Grid,
|
|
||||||
Button,
|
|
||||||
Modal,
|
|
||||||
Title,
|
|
||||||
Group,
|
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
Text,
|
Button,
|
||||||
Box,
|
Drawer,
|
||||||
Center,
|
Grid,
|
||||||
|
Group,
|
||||||
Loader,
|
Loader,
|
||||||
|
Modal,
|
||||||
|
Stack,
|
||||||
|
Text,
|
||||||
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useDisclosure, useShallowEffect } from "@mantine/hooks";
|
import { useDisclosure } from "@mantine/hooks";
|
||||||
import { IconTrash, IconEdit, IconFlag3, IconDots } from "@tabler/icons-react";
|
import { IconDots, IconFlag3, IconTrash } from "@tabler/icons-react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
import { createStyles } from "@mantine/core";
|
|
||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
import { useAtom } from "jotai";
|
|
||||||
import { gs_forum_loading_edit_posting } from "../../global_state";
|
|
||||||
import ComponentForum_LoadingDrawer from "../loading_drawer";
|
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import { forum_funDeletePostingById } from "../../fun/delete/fun_delete_posting_by_id";
|
|
||||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
|
||||||
import { forum_funDeleteKomentarById } from "../../fun/delete/fun_delete_komentar_by_id";
|
|
||||||
import { forum_funGetAllKomentarById } from "../../fun/get/get_all_komentar_by_id";
|
|
||||||
import {
|
import {
|
||||||
AccentColor,
|
AccentColor,
|
||||||
MainColor,
|
MainColor,
|
||||||
} from "@/app_modules/_global/color/color_pallet";
|
} from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
||||||
|
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||||
|
import { forum_funDeleteKomentarById } from "../../fun/delete/fun_delete_komentar_by_id";
|
||||||
|
import { forum_funGetAllKomentarById } from "../../fun/get/get_all_komentar_by_id";
|
||||||
|
|
||||||
export default function ComponentForum_KomentarButtonMore({
|
export default function ComponentForum_KomentarButtonMore({
|
||||||
userId,
|
userId,
|
||||||
@@ -200,7 +192,9 @@ function ButtonDelete({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Title order={6} c="white">Yakin menghapus komentar ini ?</Title>
|
<Title order={6} c="white">
|
||||||
|
Yakin menghapus komentar ini ?
|
||||||
|
</Title>
|
||||||
<Group position="center">
|
<Group position="center">
|
||||||
<Button radius={"xl"} onClick={() => setOpenDel(false)}>
|
<Button radius={"xl"} onClick={() => setOpenDel(false)}>
|
||||||
Batal
|
Batal
|
||||||
|
|||||||
@@ -3,39 +3,32 @@
|
|||||||
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
|
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
|
||||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||||
import {
|
import {
|
||||||
Drawer,
|
|
||||||
Stack,
|
|
||||||
Grid,
|
|
||||||
Button,
|
|
||||||
Modal,
|
|
||||||
Title,
|
|
||||||
Group,
|
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
Text,
|
Button,
|
||||||
Box,
|
Drawer,
|
||||||
Center,
|
Grid,
|
||||||
|
Group,
|
||||||
Loader,
|
Loader,
|
||||||
|
Modal,
|
||||||
|
Stack,
|
||||||
|
Text,
|
||||||
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useDisclosure, useShallowEffect } from "@mantine/hooks";
|
import { useDisclosure } from "@mantine/hooks";
|
||||||
import {
|
import {
|
||||||
IconTrash,
|
IconDots,
|
||||||
IconEdit,
|
IconEdit,
|
||||||
IconFlag3,
|
IconFlag3,
|
||||||
IconDots,
|
|
||||||
IconSquareRoundedX,
|
IconSquareRoundedX,
|
||||||
|
IconTrash,
|
||||||
} from "@tabler/icons-react";
|
} from "@tabler/icons-react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
import { createStyles } from "@mantine/core";
|
|
||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
||||||
import { useAtom } from "jotai";
|
|
||||||
import { gs_forum_loading_edit_posting } from "../../global_state";
|
|
||||||
import ComponentForum_LoadingDrawer from "../loading_drawer";
|
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import { forum_funDeletePostingById } from "../../fun/delete/fun_delete_posting_by_id";
|
|
||||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||||
import { IconSquareCheck } from "@tabler/icons-react";
|
import { IconSquareCheck } from "@tabler/icons-react";
|
||||||
|
import { forum_funDeletePostingById } from "../../fun/delete/fun_delete_posting_by_id";
|
||||||
import { forum_funEditStatusPostingById } from "../../fun/edit/fun_edit_status_posting_by_id";
|
import { forum_funEditStatusPostingById } from "../../fun/edit/fun_edit_status_posting_by_id";
|
||||||
|
|
||||||
export default function ComponentForum_DetailMoreButton({
|
export default function ComponentForum_DetailMoreButton({
|
||||||
|
|||||||
@@ -3,39 +3,30 @@
|
|||||||
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
|
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
|
||||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||||
import {
|
import {
|
||||||
Drawer,
|
|
||||||
Stack,
|
|
||||||
Grid,
|
|
||||||
Button,
|
|
||||||
Modal,
|
|
||||||
Title,
|
|
||||||
Group,
|
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
Text,
|
Button,
|
||||||
Box,
|
Drawer,
|
||||||
Center,
|
Grid,
|
||||||
|
Group,
|
||||||
Loader,
|
Loader,
|
||||||
|
Modal,
|
||||||
|
Stack,
|
||||||
|
Text,
|
||||||
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useDisclosure, useShallowEffect } from "@mantine/hooks";
|
import { useDisclosure } from "@mantine/hooks";
|
||||||
import {
|
import {
|
||||||
IconTrash,
|
IconDots,
|
||||||
IconEdit,
|
IconEdit,
|
||||||
IconFlag3,
|
IconFlag3,
|
||||||
IconDots,
|
|
||||||
IconSquareRoundedX,
|
|
||||||
IconSquareCheck,
|
IconSquareCheck,
|
||||||
|
IconSquareRoundedX,
|
||||||
|
IconTrash,
|
||||||
} from "@tabler/icons-react";
|
} from "@tabler/icons-react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
import { createStyles } from "@mantine/core";
|
|
||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
import { useAtom } from "jotai";
|
|
||||||
import { gs_forum_loading_edit_posting } from "../../global_state";
|
|
||||||
import ComponentForum_LoadingDrawer from "../loading_drawer";
|
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
import { forum_funDeletePostingById } from "../../fun/delete/fun_delete_posting_by_id";
|
|
||||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||||
|
import { forum_funDeletePostingById } from "../../fun/delete/fun_delete_posting_by_id";
|
||||||
import { forum_funEditStatusPostingById } from "../../fun/edit/fun_edit_status_posting_by_id";
|
import { forum_funEditStatusPostingById } from "../../fun/edit/fun_edit_status_posting_by_id";
|
||||||
import { forum_getListAllPosting } from "../../fun/get/get_list_all_posting";
|
import { forum_getListAllPosting } from "../../fun/get/get_list_all_posting";
|
||||||
import { forum_getAllPostingByAuhtorId } from "../../fun/get/get_list_posting_by_author_id";
|
import { forum_getAllPostingByAuhtorId } from "../../fun/get/get_list_posting_by_author_id";
|
||||||
@@ -277,9 +268,10 @@ function ButtonStatus({
|
|||||||
async (res) => {
|
async (res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
if (userLoginId === authorId) {
|
if (userLoginId === authorId) {
|
||||||
await forum_getAllPostingByAuhtorId({authorId: authorId, page: 1}).then((val: any) =>
|
await forum_getAllPostingByAuhtorId({
|
||||||
setData(val)
|
authorId: authorId,
|
||||||
);
|
page: 1,
|
||||||
|
}).then((val: any) => setData(val));
|
||||||
} else {
|
} else {
|
||||||
await forum_getListAllPosting().then((val) => setData(val as any));
|
await forum_getListAllPosting().then((val) => setData(val as any));
|
||||||
}
|
}
|
||||||
@@ -299,9 +291,10 @@ function ButtonStatus({
|
|||||||
async (res) => {
|
async (res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
if (userLoginId === authorId) {
|
if (userLoginId === authorId) {
|
||||||
await forum_getAllPostingByAuhtorId({authorId: authorId, page: 1}).then((val: any) =>
|
await forum_getAllPostingByAuhtorId({
|
||||||
setData(val)
|
authorId: authorId,
|
||||||
);
|
page: 1,
|
||||||
|
}).then((val: any) => setData(val));
|
||||||
} else {
|
} else {
|
||||||
await forum_getListAllPosting().then((val) => setData(val as any));
|
await forum_getListAllPosting().then((val) => setData(val as any));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,14 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
|
||||||
|
|
||||||
export async function forum_countPostingByAuthorId(authorId: string) {
|
export async function forum_countPostingByAuthorId(authorId: string) {
|
||||||
|
|
||||||
|
|
||||||
const data = await prisma.forum_Posting.count({
|
const data = await prisma.forum_Posting.count({
|
||||||
where: {
|
where: {
|
||||||
authorId: authorId,
|
authorId: authorId,
|
||||||
isActive: true
|
isActive: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
return data
|
return data;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,16 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { revalidatePath } from "next/cache";
|
import { revalidatePath } from "next/cache";
|
||||||
|
|
||||||
export async function forum_funCreate(value: string) {
|
export async function forum_funCreate(value: string) {
|
||||||
const AuthorId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const create = await prisma.forum_Posting.create({
|
const create = await prisma.forum_Posting.create({
|
||||||
data: {
|
data: {
|
||||||
diskusi: value,
|
diskusi: value,
|
||||||
authorId: AuthorId,
|
authorId: userLoginId,
|
||||||
forumMaster_StatusPostingId: 1
|
forumMaster_StatusPostingId: 1,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import { revalidatePath } from "next/cache";
|
import { revalidatePath } from "next/cache";
|
||||||
|
|
||||||
export async function forum_funCreateKomentar(
|
export async function forum_funCreateKomentar(
|
||||||
postingId: string,
|
postingId: string,
|
||||||
komentar: string
|
komentar: string
|
||||||
) {
|
) {
|
||||||
const authorId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const create = await prisma.forum_Komentar.create({
|
const create = await prisma.forum_Komentar.create({
|
||||||
data: {
|
data: {
|
||||||
komentar: komentar,
|
komentar: komentar,
|
||||||
forum_PostingId: postingId,
|
forum_PostingId: postingId,
|
||||||
authorId: authorId,
|
authorId: userLoginId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
|
|
||||||
export async function forum_funCreateReportKomentar({
|
export async function forum_funCreateReportKomentar({
|
||||||
komentarId,
|
komentarId,
|
||||||
@@ -10,19 +10,12 @@ export async function forum_funCreateReportKomentar({
|
|||||||
komentarId: string;
|
komentarId: string;
|
||||||
kategoriId: any;
|
kategoriId: any;
|
||||||
}) {
|
}) {
|
||||||
const authorId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
// console.log(kategoriId);
|
|
||||||
|
|
||||||
// const cekId = await prisma.forumMaster_KategoriReport.findFirst({
|
|
||||||
// where: {
|
|
||||||
// title: kategoriId,
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const createReport = await prisma.forum_ReportKomentar.create({
|
const createReport = await prisma.forum_ReportKomentar.create({
|
||||||
data: {
|
data: {
|
||||||
userId: authorId,
|
userId: userLoginId,
|
||||||
forumMaster_KategoriReportId: kategoriId,
|
forumMaster_KategoriReportId: kategoriId,
|
||||||
forum_KomentarId: komentarId,
|
forum_KomentarId: komentarId,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,18 +1,19 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
|
|
||||||
export async function forum_funCreateReportKomentarLainnya(
|
export async function forum_funCreateReportKomentarLainnya(
|
||||||
komentarId: string,
|
komentarId: string,
|
||||||
deskripsi: string
|
deskripsi: string
|
||||||
) {
|
) {
|
||||||
const authorId = await user_funGetOneUserId();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const create = await prisma.forum_ReportKomentar.create({
|
const create = await prisma.forum_ReportKomentar.create({
|
||||||
data: {
|
data: {
|
||||||
forum_KomentarId: komentarId,
|
forum_KomentarId: komentarId,
|
||||||
deskripsi: deskripsi,
|
deskripsi: deskripsi,
|
||||||
userId: authorId,
|
userId: userLoginId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user