Fix: Cookies
Deksripsi: - Perbaikan cookies untuk server
This commit is contained in:
@@ -14,19 +14,12 @@ export default async function Layout({
|
|||||||
const userLoginId = await funGetUserIdByToken();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
const version = versionUpdate.version;
|
const version = versionUpdate.version;
|
||||||
|
|
||||||
const dataUser = await funGlobal_getUserById({ userId: userLoginId });
|
const dataUser = await funGlobal_getUserById({ userId: userLoginId as string});
|
||||||
const listNotifikasi = await adminNotifikasi_getByUserId({page: 1});
|
const listNotifikasi = await adminNotifikasi_getByUserId({page: 1});
|
||||||
const countNotifikasi = await adminNotifikasi_countNotifikasi();
|
const countNotifikasi = await adminNotifikasi_countNotifikasi();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* <AdminLayout
|
|
||||||
listNotif={listNotif as any}
|
|
||||||
dataUser={dataUser as any}
|
|
||||||
countNotifikasi={countNotifikasi}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</AdminLayout> */}
|
|
||||||
<Admin_NewLayout
|
<Admin_NewLayout
|
||||||
user={dataUser as any}
|
user={dataUser as any}
|
||||||
countNotifikasi={countNotifikasi as any}
|
countNotifikasi={countNotifikasi as any}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export default async function Page({ params }: { params: { id: string } }) {
|
|||||||
"ProjectCollaboration_AnggotaRoomChat",
|
"ProjectCollaboration_AnggotaRoomChat",
|
||||||
]);
|
]);
|
||||||
let listMsg = await colab_getMessageByRoomId({ roomId: roomId, page: 1 });
|
let listMsg = await colab_getMessageByRoomId({ roomId: roomId, page: 1 });
|
||||||
const dataUserLogin = await user_getOneByUserId(userLoginId);
|
const dataUserLogin = await user_getOneByUserId(userLoginId as string);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -29,7 +29,7 @@ export default async function Page({ params }: { params: { id: string } }) {
|
|||||||
/> */}
|
/> */}
|
||||||
|
|
||||||
<Colab_GroupChatView
|
<Colab_GroupChatView
|
||||||
userLoginId={userLoginId}
|
userLoginId={userLoginId as string}
|
||||||
listMsg={listMsg}
|
listMsg={listMsg}
|
||||||
selectRoom={dataRoom as any}
|
selectRoom={dataRoom as any}
|
||||||
dataUserLogin={dataUserLogin as any}
|
dataUserLogin={dataUserLogin as any}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export default async function Page({ params }: { params: { id: string } }) {
|
|||||||
<>
|
<>
|
||||||
<Colab_MainDetail
|
<Colab_MainDetail
|
||||||
dataColab={dataColab as any}
|
dataColab={dataColab as any}
|
||||||
userLoginId={userLoginId}
|
userLoginId={userLoginId as string}
|
||||||
listPartisipan={listPartisipan as any}
|
listPartisipan={listPartisipan as any}
|
||||||
cekPartisipan={cekPartisipan}
|
cekPartisipan={cekPartisipan}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export default async function Page() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Colab_Beranda listData={listData as any} userLoginId={userLoginId} />
|
<Colab_Beranda listData={listData as any} userLoginId={userLoginId as string} />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export default async function Page({ params }: { params: { id: string } }) {
|
|||||||
<>
|
<>
|
||||||
<CreateCeritaPenggalangDonasi
|
<CreateCeritaPenggalangDonasi
|
||||||
dataTemporary={getTemporaryCreate as any}
|
dataTemporary={getTemporaryCreate as any}
|
||||||
userId={userLoginId}
|
userId={userLoginId as string}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export default async function Layout({
|
|||||||
<LayoutDetailMainDonasi
|
<LayoutDetailMainDonasi
|
||||||
donasiId={donasiId}
|
donasiId={donasiId}
|
||||||
authorId={authorId as any}
|
authorId={authorId as any}
|
||||||
userLoginId={userLoginId}
|
userLoginId={userLoginId as string}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</LayoutDetailMainDonasi>
|
</LayoutDetailMainDonasi>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export default async function Page({ params }: { params: { id: string } }) {
|
|||||||
<DetailMainDonasi
|
<DetailMainDonasi
|
||||||
dataDonasi={dataDonasi as any}
|
dataDonasi={dataDonasi as any}
|
||||||
countDonatur={countDonatur}
|
countDonatur={countDonatur}
|
||||||
userLoginId={userLoginId}
|
userLoginId={userLoginId as string}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ export default async function Page({ params }: { params: { id: string } }) {
|
|||||||
<DetailPublishDonasi
|
<DetailPublishDonasi
|
||||||
dataPublish={dataPublish as any}
|
dataPublish={dataPublish as any}
|
||||||
countDonatur={countDonatur}
|
countDonatur={countDonatur}
|
||||||
userLoginId={userLoginId}
|
userLoginId={userLoginId as string}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export default async function Page({ params }: { params: { id: string } }) {
|
|||||||
<Donasi_MetodePembayaran
|
<Donasi_MetodePembayaran
|
||||||
listBank={listBank}
|
listBank={listBank}
|
||||||
donasiId={donasiId}
|
donasiId={donasiId}
|
||||||
authorId={userLoginId}
|
authorId={userLoginId as string}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ export default async function Page() {
|
|||||||
const listTipeAcara = await Event_getMasterTipeAcara();
|
const listTipeAcara = await Event_getMasterTipeAcara();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Event_Create listTipeAcara={listTipeAcara as any} authorId={userLoginId} />
|
<Event_Create
|
||||||
|
listTipeAcara={listTipeAcara as any}
|
||||||
|
authorId={userLoginId as string}
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
|
|||||||
|
|
||||||
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 funGetUserIdByToken();
|
const userLoginId : any= await funGetUserIdByToken();
|
||||||
|
|
||||||
const dataEvent = await event_getOneById(eventId);
|
const dataEvent = await event_getOneById(eventId);
|
||||||
const listPeserta = await Event_getListPesertaById(eventId);
|
const listPeserta = await Event_getListPesertaById(eventId);
|
||||||
@@ -19,7 +19,7 @@ export default async function Page({ params }: { params: { id: string } }) {
|
|||||||
<Event_DetailMain
|
<Event_DetailMain
|
||||||
dataEvent={dataEvent as any}
|
dataEvent={dataEvent as any}
|
||||||
listPeserta={listPeserta as any}
|
listPeserta={listPeserta as any}
|
||||||
userLoginId={userLoginId}
|
userLoginId={userLoginId as string}
|
||||||
isJoin={isJoin}
|
isJoin={isJoin}
|
||||||
totalPeserta={totalPeserta as any}
|
totalPeserta={totalPeserta as any}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export default async function Page({ params }: { params: { id: string } }) {
|
|||||||
<Forum_MainDetail
|
<Forum_MainDetail
|
||||||
dataPosting={dataPosting as any}
|
dataPosting={dataPosting as any}
|
||||||
listKomentar={listKomentar as any}
|
listKomentar={listKomentar as any}
|
||||||
userLoginId={userLoginId}
|
userLoginId={userLoginId as string}
|
||||||
countKomentar={countKomentar}
|
countKomentar={countKomentar}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export default async function Layout({
|
|||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
const userLoginId = await funGetUserIdByToken();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
const dataAuthor = await user_getOneByUserId(userLoginId);
|
const dataAuthor = await user_getOneByUserId(userLoginId as string);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -8,7 +8,10 @@ export default async function Page() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Forum_Beranda listForum={listForum as any} userLoginId={userLoginId} />
|
<Forum_Beranda
|
||||||
|
listForum={listForum as any}
|
||||||
|
userLoginId={userLoginId as string}
|
||||||
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export default async function Page({ params }: { params: { id: string } }) {
|
|||||||
<>
|
<>
|
||||||
<Forum_ReportKomentarLainnya
|
<Forum_ReportKomentarLainnya
|
||||||
komentarId={komentarId}
|
komentarId={komentarId}
|
||||||
userLoginId={userLoginId}
|
userLoginId={userLoginId as string}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export default async function Page({ params }: { params: { id: string } }) {
|
|||||||
<>
|
<>
|
||||||
<Forum_ReportPostingLainnya
|
<Forum_ReportPostingLainnya
|
||||||
postingId={postingId}
|
postingId={postingId}
|
||||||
userLoginId={userLoginId}
|
userLoginId={userLoginId as string}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ export default async function Page({ params }: { params: { id: string } }) {
|
|||||||
<Forum_ReportPosting
|
<Forum_ReportPosting
|
||||||
postingId={postingId}
|
postingId={postingId}
|
||||||
listReport={listReport as any}
|
listReport={listReport as any}
|
||||||
userLoginId={userLoginId}
|
userLoginId={userLoginId as string}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { redirect } from "next/navigation";
|
|||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const userLoginId = await funGetUserIdByToken();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const dataUser = await user_getOneByUserId(userLoginId);
|
const dataUser = await user_getOneByUserId(userLoginId as string);
|
||||||
const dataJob = await job_getTwoForHomeView();
|
const dataJob = await job_getTwoForHomeView();
|
||||||
|
|
||||||
if (dataUser?.active === false) {
|
if (dataUser?.active === false) {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ export default async function Page({ params }: { params: { id: string } }) {
|
|||||||
<>
|
<>
|
||||||
<Investasi_UiDetailMain
|
<Investasi_UiDetailMain
|
||||||
dataInvestasi={dataInvestasi as any}
|
dataInvestasi={dataInvestasi as any}
|
||||||
userLoginId={userLoginId}
|
userLoginId={userLoginId as string}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export default async function Page({ params }: { params: { id: string } }) {
|
|||||||
<>
|
<>
|
||||||
<Investasi_UiDetailPortofolio
|
<Investasi_UiDetailPortofolio
|
||||||
dataInvestasi={dataPortofolio as any}
|
dataInvestasi={dataPortofolio as any}
|
||||||
userLoginId={userLoginId}
|
userLoginId={userLoginId as string}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -9,7 +9,9 @@ export default async function Page() {
|
|||||||
const userLoginId = await funGetUserIdByToken();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const statusTransaksi = await getMaster_StatusTransaksiInvestasi();
|
const statusTransaksi = await getMaster_StatusTransaksiInvestasi();
|
||||||
const listTransaksi = await getListAllTransaksiById_Investasi(userLoginId);
|
const listTransaksi = await getListAllTransaksiById_Investasi(
|
||||||
|
userLoginId as string
|
||||||
|
);
|
||||||
|
|
||||||
// NEW
|
// NEW
|
||||||
const dataTransaksi = await investasi_funGetTransaksiByUserId({ page: 1 });
|
const dataTransaksi = await investasi_funGetTransaksiByUserId({ page: 1 });
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_b
|
|||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
const userLoginId = await funGetUserIdByToken();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const userLogin = await funGetUserProfile(userLoginId);
|
const userLogin = await funGetUserProfile(userLoginId as string);
|
||||||
const dataInvestasi = await getOneInvestasiById(params.id);
|
const dataInvestasi = await getOneInvestasiById(params.id);
|
||||||
|
|
||||||
// console.log(dataInvestasi);
|
// console.log(dataInvestasi);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export default async function Layout({
|
|||||||
<>
|
<>
|
||||||
<KatalogLayout
|
<KatalogLayout
|
||||||
profileId={profileId}
|
profileId={profileId}
|
||||||
userLoginId={userLoginId}
|
userLoginId={userLoginId as string}
|
||||||
authorId={authorId as any}
|
authorId={authorId as any}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export default async function Layout({
|
|||||||
<>
|
<>
|
||||||
<PortofolioLayout
|
<PortofolioLayout
|
||||||
portoId={portoId}
|
portoId={portoId}
|
||||||
userLoginId={userLoginId}
|
userLoginId={userLoginId as string}
|
||||||
authorId={getPorto?.Profile?.User?.id as any}
|
authorId={getPorto?.Profile?.User?.id as any}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
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() {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { redirect } from "next/navigation";
|
|||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const userLoginId = await funGetUserIdByToken();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const dataUser = await user_getOneByUserId(userLoginId);
|
const dataUser = await user_getOneByUserId(userLoginId as string);
|
||||||
|
|
||||||
if (dataUser?.active === true) {
|
if (dataUser?.active === true) {
|
||||||
return redirect(RouterHome.main_home);
|
return redirect(RouterHome.main_home);
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export default async function Layout({
|
|||||||
<>
|
<>
|
||||||
<LayoutVote_DetailKontribusi
|
<LayoutVote_DetailKontribusi
|
||||||
votingId={votingId}
|
votingId={votingId}
|
||||||
userLoginId={userLoginId}
|
userLoginId={userLoginId as string}
|
||||||
dataVoting={dataVoting}
|
dataVoting={dataVoting}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
@@ -11,14 +11,14 @@ export default async function Layout({
|
|||||||
params: { id: string };
|
params: { id: string };
|
||||||
}) {
|
}) {
|
||||||
const votingId = params.id;
|
const votingId = params.id;
|
||||||
const userLoginId = await funGetUserIdByToken();
|
const userLoginId = await funGetUserIdByToken();
|
||||||
const dataVoting = await voting_funGetOneVotingbyId(votingId);
|
const dataVoting = await voting_funGetOneVotingbyId(votingId);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<LayoutVote_MainDetail
|
<LayoutVote_MainDetail
|
||||||
votingId={votingId}
|
votingId={votingId}
|
||||||
userLoginId={userLoginId}
|
userLoginId={userLoginId as string}
|
||||||
dataVoting={dataVoting}
|
dataVoting={dataVoting}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export default async function Page({ params }: { params: { id: string } }) {
|
|||||||
isKontributor={isKontributor}
|
isKontributor={isKontributor}
|
||||||
pilihanKontributor={pilihanKontributor as any}
|
pilihanKontributor={pilihanKontributor as any}
|
||||||
listKontributor={listKontributor as any}
|
listKontributor={listKontributor as any}
|
||||||
userLoginId={userLoginId}
|
userLoginId={userLoginId as string}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export default async function Layout({
|
|||||||
<>
|
<>
|
||||||
<LayoutVote_DetailPublish
|
<LayoutVote_DetailPublish
|
||||||
votingId={votingId}
|
votingId={votingId}
|
||||||
userLoginId={userLoginId}
|
userLoginId={userLoginId as string}
|
||||||
dataVoting={dataVoting}
|
dataVoting={dataVoting}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ export default async function RootLayout({
|
|||||||
<RootStyleRegistry>
|
<RootStyleRegistry>
|
||||||
{/* <MqttLoader />
|
{/* <MqttLoader />
|
||||||
<TokenProvider token={token} envObject={envObject} /> */}
|
<TokenProvider token={token} envObject={envObject} /> */}
|
||||||
<RealtimeProvider userLoginId={userLoginId} />
|
<RealtimeProvider userLoginId={userLoginId as string} />
|
||||||
{children}
|
{children}
|
||||||
</RootStyleRegistry>
|
</RootStyleRegistry>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
import Coba_TestLoading from "@/app_modules/zCoba";
|
import Coba_TestLoading from "@/app_modules/zCoba";
|
||||||
import { CobaRealtime } from "@/app_modules/zCoba/coba_realtime";
|
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
await new Promise((a, b) => {
|
await new Promise((a, b) => {
|
||||||
@@ -12,7 +11,7 @@ export default async function Page() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* <CobaRealtime userLoginId={userLoginId} /> */}
|
{/* <CobaRealtime userLoginId={userLoginId} /> */}
|
||||||
<Coba_TestLoading userLoginId={userLoginId} />
|
<Coba_TestLoading userLoginId={userLoginId as string} />
|
||||||
{/* <ComponentGlobal_UI_LayoutTamplate /> */}
|
{/* <ComponentGlobal_UI_LayoutTamplate /> */}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import { prisma } from "@/app/lib";
|
import { prisma } from "@/app/lib";
|
||||||
|
import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
|
||||||
|
import { permanentRedirect } from "next/navigation";
|
||||||
|
|
||||||
export async function funGlobal_getUserById({ userId }: { userId: string }) {
|
export async function funGlobal_getUserById({ userId }: { userId: string }) {
|
||||||
|
if (!userId) return permanentRedirect(RouterAuth.login);
|
||||||
|
|
||||||
const data = await prisma.user.findFirst({
|
const data = await prisma.user.findFirst({
|
||||||
where: {
|
where: {
|
||||||
id: userId,
|
id: userId,
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import { cookies } from "next/headers";
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { redirect } from "next/navigation";
|
import { cookies } from "next/headers";
|
||||||
import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
|
|
||||||
|
|
||||||
export async function funGetUserIdByToken() {
|
export async function funGetUserIdByToken() {
|
||||||
const c = cookies().get("ssn");
|
const c = cookies().get("ssn");
|
||||||
|
const token = c?.value
|
||||||
const cekToken = await prisma.userSession.findFirst({
|
const cekToken = await prisma.userSession.findFirst({
|
||||||
where: {
|
where: {
|
||||||
token: c?.value,
|
token: token,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (cekToken === null) return redirect(RouterAuth.login);
|
if (cekToken === null) return null
|
||||||
return cekToken.userId;
|
return cekToken.userId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,141 @@
|
|||||||
import { AccentColor } from "@/app_modules/_global/color";
|
"use client";
|
||||||
import { MODEL_USER } from "@/app_modules/home/model/interface";
|
|
||||||
import { Menu, ActionIcon, Stack, Grid, Center, Text } from "@mantine/core";
|
|
||||||
import { IconUserCircle, IconUser, IconPhone } from "@tabler/icons-react";
|
|
||||||
import { useState } from "react";
|
|
||||||
import Admin_Logout from "../logout";
|
|
||||||
|
|
||||||
export function Admin_ComponentButtonUserCircle({ dataUser }: { dataUser: MODEL_USER }) {
|
import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
|
||||||
|
import { Warna } from "@/app/lib/warna";
|
||||||
|
import { AccentColor } from "@/app_modules/_global/color";
|
||||||
|
import {
|
||||||
|
ComponentGlobal_NotifikasiBerhasil,
|
||||||
|
ComponentGlobal_NotifikasiPeringatan,
|
||||||
|
} from "@/app_modules/_global/notif_global";
|
||||||
|
import { auth_Logout } from "@/app_modules/auth/fun/fun_logout";
|
||||||
|
import { gs_kodeId } from "@/app_modules/auth/state/state";
|
||||||
|
import { MODEL_USER } from "@/app_modules/home/model/interface";
|
||||||
|
import {
|
||||||
|
ActionIcon,
|
||||||
|
Button,
|
||||||
|
Center,
|
||||||
|
Divider,
|
||||||
|
Grid,
|
||||||
|
Group,
|
||||||
|
Menu,
|
||||||
|
Modal,
|
||||||
|
Popover,
|
||||||
|
Stack,
|
||||||
|
Text,
|
||||||
|
Title,
|
||||||
|
} from "@mantine/core";
|
||||||
|
import { IconPhone, IconUser, IconUserCircle } from "@tabler/icons-react";
|
||||||
|
import { useAtom } from "jotai";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
|
export function Admin_ComponentButtonUserCircle({
|
||||||
|
dataUser,
|
||||||
|
}: {
|
||||||
|
dataUser: MODEL_USER;
|
||||||
|
}) {
|
||||||
|
const router = useRouter();
|
||||||
const [isOpenMenuUser, setOpenMenuUser] = useState(false);
|
const [isOpenMenuUser, setOpenMenuUser] = useState(false);
|
||||||
|
const [openPop, setOpenPop] = useState(false);
|
||||||
|
const [openModal, setOpenModal] = useState(false);
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
const [kodeId, setKodeId] = useAtom(gs_kodeId);
|
||||||
|
const [loadingLogout, setLoadingLogout] = useState(false);
|
||||||
|
|
||||||
|
async function onClickLogout() {
|
||||||
|
const res = await auth_Logout();
|
||||||
|
if (res.status === 200) {
|
||||||
|
console.log(res);
|
||||||
|
setLoadingLogout(true);
|
||||||
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
|
setKodeId("");
|
||||||
|
setOpenModal(false);
|
||||||
|
router.push(RouterAuth.login, { scroll: false });
|
||||||
|
} else {
|
||||||
|
ComponentGlobal_NotifikasiPeringatan(res.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Popover opened={openPop} onChange={setOpenPop} position="right-end">
|
||||||
|
<Popover.Target>
|
||||||
|
<ActionIcon
|
||||||
|
variant="transparent"
|
||||||
|
onClick={() => {
|
||||||
|
setOpenPop((o) => !o);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<IconUserCircle color="white" />
|
||||||
|
</ActionIcon>
|
||||||
|
</Popover.Target>
|
||||||
|
|
||||||
|
<Popover.Dropdown style={{ backgroundColor: AccentColor.blue }}>
|
||||||
|
<Stack>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={2}>
|
||||||
|
<IconUser />
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={"auto"}>
|
||||||
|
<Text lineClamp={1}>{dataUser.username}</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={2}>
|
||||||
|
<IconPhone />
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={"auto"}>
|
||||||
|
<Text lineClamp={1}>+{dataUser.nomor}</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<Divider />
|
||||||
|
|
||||||
|
<Center>
|
||||||
|
<Button radius={"xl"} onClick={() => setOpenModal(true)}>
|
||||||
|
Keluar
|
||||||
|
</Button>
|
||||||
|
</Center>
|
||||||
|
</Stack>
|
||||||
|
</Popover.Dropdown>
|
||||||
|
</Popover>
|
||||||
|
|
||||||
|
<Modal
|
||||||
|
opened={openModal}
|
||||||
|
onClose={() => setOpenModal(false)}
|
||||||
|
centered
|
||||||
|
withCloseButton={false}
|
||||||
|
closeOnClickOutside={false}
|
||||||
|
>
|
||||||
|
<Stack>
|
||||||
|
<Title order={6}>Anda yakin ingin keluar ?</Title>
|
||||||
|
<Group align="center" position="center">
|
||||||
|
<Button
|
||||||
|
onClick={() => {
|
||||||
|
setOpenModal(false);
|
||||||
|
setLoading(false);
|
||||||
|
}}
|
||||||
|
radius={50}
|
||||||
|
>
|
||||||
|
Batal
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
loaderPosition="center"
|
||||||
|
loading={loadingLogout ? true : false}
|
||||||
|
radius={50}
|
||||||
|
bg={Warna.merah}
|
||||||
|
color="red"
|
||||||
|
onClick={() => onClickLogout()}
|
||||||
|
>
|
||||||
|
Keluar
|
||||||
|
</Button>
|
||||||
|
</Group>
|
||||||
|
</Stack>
|
||||||
|
</Modal>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Menu
|
<Menu
|
||||||
@@ -35,41 +164,44 @@ export function Admin_ComponentButtonUserCircle({ dataUser }: { dataUser: MODEL_
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Menu.Target>
|
<Menu.Target>
|
||||||
<ActionIcon variant="transparent" onClick={() => console.log("test")}>
|
<IconUserCircle color="white" />
|
||||||
<IconUserCircle color="white" />
|
{/* <ActionIcon variant="transparent">
|
||||||
</ActionIcon>
|
</ActionIcon> */}
|
||||||
</Menu.Target>
|
</Menu.Target>
|
||||||
|
|
||||||
<Menu.Dropdown>
|
<Menu.Dropdown>
|
||||||
<Stack spacing={5} px={"xs"}>
|
<Menu.Item>
|
||||||
<Menu.Item>
|
<Grid>
|
||||||
<Grid>
|
<Grid.Col span={2}>
|
||||||
<Grid.Col span={2}>
|
<IconUser />
|
||||||
<IconUser />
|
</Grid.Col>
|
||||||
</Grid.Col>
|
<Grid.Col span={"auto"}>
|
||||||
<Grid.Col span={"auto"}>
|
<Text lineClamp={1}>{dataUser.username}</Text>
|
||||||
<Text lineClamp={1}>{dataUser.username}</Text>
|
</Grid.Col>
|
||||||
</Grid.Col>
|
</Grid>
|
||||||
</Grid>
|
</Menu.Item>
|
||||||
</Menu.Item>
|
<Menu.Item>
|
||||||
<Menu.Item>
|
<Grid>
|
||||||
<Grid>
|
<Grid.Col span={2}>
|
||||||
<Grid.Col span={2}>
|
<IconPhone />
|
||||||
<IconPhone />
|
</Grid.Col>
|
||||||
</Grid.Col>
|
<Grid.Col span={"auto"}>
|
||||||
<Grid.Col span={"auto"}>
|
<Text lineClamp={1}>+{dataUser.nomor}</Text>
|
||||||
<Text lineClamp={1}>+{dataUser.nomor}</Text>
|
</Grid.Col>
|
||||||
</Grid.Col>
|
</Grid>
|
||||||
</Grid>
|
</Menu.Item>
|
||||||
</Menu.Item>
|
|
||||||
|
|
||||||
<Menu.Divider />
|
<Menu.Divider />
|
||||||
<Center py={"xs"}>
|
|
||||||
|
<Menu.Item>
|
||||||
|
{/* <Center py={"xs"}>
|
||||||
<Admin_Logout />
|
<Admin_Logout />
|
||||||
</Center>
|
</Center> */}
|
||||||
</Stack>
|
{/* <Button>Keluar</Button> */}
|
||||||
|
<Text>Keluar</Text>
|
||||||
|
</Menu.Item>
|
||||||
</Menu.Dropdown>
|
</Menu.Dropdown>
|
||||||
</Menu>
|
</Menu>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,20 +26,19 @@ export default function Admin_Logout() {
|
|||||||
const [loadingLogout, setLoadingLogout] = useState(false);
|
const [loadingLogout, setLoadingLogout] = useState(false);
|
||||||
|
|
||||||
async function onClickLogout() {
|
async function onClickLogout() {
|
||||||
await auth_Logout().then((res) => {
|
const res = await auth_Logout()
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
setLoadingLogout(true);
|
setLoadingLogout(true);
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
setKodeId("");
|
setKodeId("");
|
||||||
} else {
|
} else {
|
||||||
ComponentGlobal_NotifikasiPeringatan(res.message);
|
ComponentGlobal_NotifikasiPeringatan(res.message);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Modal
|
{/* <Modal
|
||||||
opened={opened}
|
opened={opened}
|
||||||
onClose={() => setOpened(false)}
|
onClose={() => setOpened(false)}
|
||||||
centered
|
centered
|
||||||
@@ -70,7 +69,7 @@ export default function Admin_Logout() {
|
|||||||
</Button>
|
</Button>
|
||||||
</Group>
|
</Group>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Modal>
|
</Modal> */}
|
||||||
<ActionIcon variant="transparent">
|
<ActionIcon variant="transparent">
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<Loader color="gray" />
|
<Loader color="gray" />
|
||||||
|
|||||||
@@ -33,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: userLoginId,
|
adminId: userLoginId as string,
|
||||||
userId: projectUpdate.userId as any,
|
userId: projectUpdate.userId as any,
|
||||||
note: "Project Anda Telah Direport Admin",
|
note: "Project Anda Telah Direport Admin",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -11,22 +11,20 @@ export async function auth_Logout() {
|
|||||||
try {
|
try {
|
||||||
const delToken = await prisma.userSession.delete({
|
const delToken = await prisma.userSession.delete({
|
||||||
where: {
|
where: {
|
||||||
userId: userId,
|
userId: userId as string,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!delToken) return { status: 400, message: "Gagal Hapus User Session" };
|
if (!delToken) return { status: 400, message: "Gagal Hapus User Session" };
|
||||||
cookies().set({
|
|
||||||
name: "ssn",
|
|
||||||
value: "",
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
|
cookies().delete({
|
||||||
|
name: "ssn",
|
||||||
|
});
|
||||||
return { status: 200, message: "Logout Berhasil" };
|
return { status: 200, message: "Logout Berhasil" };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
revalidatePath("/");
|
revalidatePath("/");
|
||||||
return { status: 200, message: "Logout Berhasil" };
|
return { status: 200, message: "Anda Berhasil Logout" };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { IconLogout } from "@tabler/icons-react";
|
|||||||
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 { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
|
||||||
|
|
||||||
export default function Component_Logout() {
|
export default function Component_Logout() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -16,13 +17,13 @@ export default function Component_Logout() {
|
|||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
async function onClickLogout() {
|
async function onClickLogout() {
|
||||||
await auth_Logout().then((res) => {
|
const res = await auth_Logout();
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
} else {
|
router.push(RouterAuth.login, { scroll: false });
|
||||||
ComponentGlobal_NotifikasiPeringatan(res.message);
|
} else {
|
||||||
}
|
ComponentGlobal_NotifikasiPeringatan(res.message);
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -12,14 +12,14 @@ 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");
|
||||||
console.log(cek, "ini cek");
|
|
||||||
const result = await cek.json();
|
const result = await cek.json();
|
||||||
console.log(result, "ini result");
|
|
||||||
if (result.success === false) {
|
if (result.success === false) {
|
||||||
router.push(RouterAuth.login, { scroll: false });
|
router.push(RouterAuth.login, { scroll: false });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,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: userLoginId,
|
userId: userLoginId as string,
|
||||||
projectCollaboration_RoomChatId: createRoom.id,
|
projectCollaboration_RoomChatId: createRoom.id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export default async function colab_CekNotifikasi() {
|
|||||||
|
|
||||||
const cekNotif = await prisma.projectCollaboration_Notifikasi.findMany({
|
const cekNotif = await prisma.projectCollaboration_Notifikasi.findMany({
|
||||||
where: {
|
where: {
|
||||||
userId: userLoginId,
|
userId: userLoginId as string,
|
||||||
isRead: false,
|
isRead: false,
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export default async function colab_getListNotifikasiByUserId() {
|
|||||||
createdAt: "desc",
|
createdAt: "desc",
|
||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
userId: userLoginId,
|
userId: userLoginId as string,
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export default async function colab_getListRoomChatByAuthorId({
|
|||||||
createdAt: "desc",
|
createdAt: "desc",
|
||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
userId: userLoginId,
|
userId: userLoginId as string,
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
ProjectCollaboration_RoomChat: {
|
ProjectCollaboration_RoomChat: {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
|
|
||||||
export async function user_getOneByUserId(userId: string) {
|
export async function user_getOneByUserId(userId?: string) {
|
||||||
const data = await prisma.user.findFirst({
|
const data = await prisma.user.findFirst({
|
||||||
where: {
|
where: {
|
||||||
id: userId,
|
id: userId,
|
||||||
|
|||||||
@@ -1,102 +0,0 @@
|
|||||||
"use server";
|
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
|
||||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
|
||||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
|
||||||
import fs from "fs";
|
|
||||||
import _ from "lodash";
|
|
||||||
import { revalidatePath } from "next/cache";
|
|
||||||
import { v4 } from "uuid";
|
|
||||||
import { MODEL_INVESTASI } from "../_lib/interface";
|
|
||||||
|
|
||||||
export async function funCreateInvestasi(
|
|
||||||
fileGambar: FormData,
|
|
||||||
filePdf: FormData,
|
|
||||||
data: MODEL_INVESTASI
|
|
||||||
) {
|
|
||||||
const userLoginId = await funGetUserIdByToken();
|
|
||||||
|
|
||||||
// Function upload gambar
|
|
||||||
const gambar: any = fileGambar.get("file");
|
|
||||||
const gambarName = gambar.name;
|
|
||||||
const gambarExtention = _.lowerCase(gambar.name.split(".").pop());
|
|
||||||
const gambarRandomName = v4(gambarName) + "." + gambarExtention;
|
|
||||||
|
|
||||||
const uploadImage = await prisma.images.create({
|
|
||||||
data: {
|
|
||||||
url: gambarRandomName,
|
|
||||||
label: "INVESTASI",
|
|
||||||
},
|
|
||||||
select: {
|
|
||||||
id: true,
|
|
||||||
url: true,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!uploadImage)
|
|
||||||
return {
|
|
||||||
status: 400,
|
|
||||||
message: "Gambar Kosong",
|
|
||||||
};
|
|
||||||
|
|
||||||
const upFolder = Buffer.from(await gambar.arrayBuffer());
|
|
||||||
fs.writeFileSync(`./public/investasi/${uploadImage.url}`, upFolder);
|
|
||||||
|
|
||||||
const createInvest = await prisma.investasi.create({
|
|
||||||
data: {
|
|
||||||
authorId: userLoginId,
|
|
||||||
title: _.startCase(data.title),
|
|
||||||
targetDana: data.targetDana.toString(),
|
|
||||||
hargaLembar: data.hargaLembar.toString(),
|
|
||||||
totalLembar: data.totalLembar.toString(),
|
|
||||||
sisaLembar: data.totalLembar.toString(),
|
|
||||||
roi: data.roi.toString(),
|
|
||||||
masterPembagianDevidenId: data.masterPembagianDevidenId,
|
|
||||||
masterPeriodeDevidenId: data.masterPeriodeDevidenId,
|
|
||||||
masterPencarianInvestorId: data.masterPencarianInvestorId,
|
|
||||||
imagesId: uploadImage.id,
|
|
||||||
masterStatusInvestasiId: "2",
|
|
||||||
},
|
|
||||||
select: {
|
|
||||||
id: true,
|
|
||||||
title: true,
|
|
||||||
authorId: true,
|
|
||||||
MasterStatusInvestasi: {
|
|
||||||
select: {
|
|
||||||
name: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!createInvest)
|
|
||||||
return {
|
|
||||||
status: 400,
|
|
||||||
message: "Gagal Disimpan",
|
|
||||||
};
|
|
||||||
|
|
||||||
// await funUploadProspektusInvestasi(filePdf, createInvest.id);
|
|
||||||
|
|
||||||
const file: any = filePdf.get("file");
|
|
||||||
const fName = file.name;
|
|
||||||
const fExt = _.lowerCase(file.name.split(".").pop());
|
|
||||||
const fRandomName = v4(fName) + "." + fExt;
|
|
||||||
|
|
||||||
const createFile = await prisma.prospektusInvestasi.create({
|
|
||||||
data: {
|
|
||||||
investasiId: createInvest.id,
|
|
||||||
url: fRandomName,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!createFile) return { status: 400, message: "Gagal Upload" };
|
|
||||||
const uploadFile = Buffer.from(await file.arrayBuffer());
|
|
||||||
fs.writeFileSync(`./public/file/${createFile.url}`, uploadFile);
|
|
||||||
|
|
||||||
revalidatePath(RouterInvestasi_OLD.main_porto);
|
|
||||||
return {
|
|
||||||
data: createInvest,
|
|
||||||
status: 201,
|
|
||||||
message: "Berhasil Disimpan",
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -37,7 +37,7 @@ export async function userSearch_getAllUser({
|
|||||||
OR: [
|
OR: [
|
||||||
{
|
{
|
||||||
NOT: {
|
NOT: {
|
||||||
id: userLoginId,
|
id: userLoginId as string,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export async function Vote_funCreate(req: MODEL_VOTING, listVote: any[]) {
|
|||||||
deskripsi: req.deskripsi,
|
deskripsi: req.deskripsi,
|
||||||
awalVote: req.awalVote,
|
awalVote: req.awalVote,
|
||||||
akhirVote: req.akhirVote,
|
akhirVote: req.akhirVote,
|
||||||
authorId: userLoginId,
|
authorId: userLoginId as string,
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export async function Vote_getAllListRiwayatSaya({ page }: { page: number }) {
|
|||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
voting_StatusId: "1",
|
voting_StatusId: "1",
|
||||||
authorId: userLoginId,
|
authorId: userLoginId as string,
|
||||||
isActive: true,
|
isActive: true,
|
||||||
akhirVote: {
|
akhirVote: {
|
||||||
lte: new Date(),
|
lte: new Date(),
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export async function vote_funGetAllByStatusId({
|
|||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
voting_StatusId: "1",
|
voting_StatusId: "1",
|
||||||
authorId: userLoginId,
|
authorId: userLoginId as string,
|
||||||
isActive: true,
|
isActive: true,
|
||||||
akhirVote: {
|
akhirVote: {
|
||||||
gte: new Date(),
|
gte: new Date(),
|
||||||
@@ -49,7 +49,7 @@ export async function vote_funGetAllByStatusId({
|
|||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
voting_StatusId: statusId,
|
voting_StatusId: statusId,
|
||||||
authorId: userLoginId,
|
authorId: userLoginId as string,
|
||||||
isActive: true,
|
isActive: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export async function vote_getAllDraft({ page }: { page: number }) {
|
|||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
voting_StatusId: "3",
|
voting_StatusId: "3",
|
||||||
authorId: userLoginId,
|
authorId: userLoginId as string,
|
||||||
isActive: true,
|
isActive: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export async function vote_getAllPublish({ page }: { page: number }) {
|
|||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
voting_StatusId: "1",
|
voting_StatusId: "1",
|
||||||
authorId: userLoginId,
|
authorId: userLoginId as string,
|
||||||
isActive: true,
|
isActive: true,
|
||||||
akhirVote: {
|
akhirVote: {
|
||||||
gte: new Date(),
|
gte: new Date(),
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export async function vote_getAllReject({ page }: { page: number }) {
|
|||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
voting_StatusId: "4",
|
voting_StatusId: "4",
|
||||||
authorId: userLoginId,
|
authorId: userLoginId as string,
|
||||||
isActive: true,
|
isActive: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export async function vote_getAllReview({ page }: { page: number }) {
|
|||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
voting_StatusId: "2",
|
voting_StatusId: "2",
|
||||||
authorId: userLoginId,
|
authorId: userLoginId as string,
|
||||||
isActive: true,
|
isActive: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user