fix
Deskripsi: - Upload ke stroage untuk job ## Np Issuee
This commit is contained in:
@@ -3,38 +3,30 @@
|
||||
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||
import {
|
||||
Drawer,
|
||||
Stack,
|
||||
Grid,
|
||||
Button,
|
||||
Modal,
|
||||
Title,
|
||||
Group,
|
||||
ActionIcon,
|
||||
Text,
|
||||
Box,
|
||||
Center,
|
||||
Button,
|
||||
Drawer,
|
||||
Grid,
|
||||
Group,
|
||||
Loader,
|
||||
Modal,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useDisclosure, useShallowEffect } from "@mantine/hooks";
|
||||
import { IconTrash, IconEdit, IconFlag3, IconDots } from "@tabler/icons-react";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { IconDots, IconFlag3, IconTrash } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
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 {
|
||||
AccentColor,
|
||||
MainColor,
|
||||
} 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({
|
||||
userId,
|
||||
@@ -200,7 +192,9 @@ function ButtonDelete({
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<Title order={6} c="white">Yakin menghapus komentar ini ?</Title>
|
||||
<Title order={6} c="white">
|
||||
Yakin menghapus komentar ini ?
|
||||
</Title>
|
||||
<Group position="center">
|
||||
<Button radius={"xl"} onClick={() => setOpenDel(false)}>
|
||||
Batal
|
||||
|
||||
@@ -3,39 +3,32 @@
|
||||
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||
import {
|
||||
Drawer,
|
||||
Stack,
|
||||
Grid,
|
||||
Button,
|
||||
Modal,
|
||||
Title,
|
||||
Group,
|
||||
ActionIcon,
|
||||
Text,
|
||||
Box,
|
||||
Center,
|
||||
Button,
|
||||
Drawer,
|
||||
Grid,
|
||||
Group,
|
||||
Loader,
|
||||
Modal,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useDisclosure, useShallowEffect } from "@mantine/hooks";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import {
|
||||
IconTrash,
|
||||
IconDots,
|
||||
IconEdit,
|
||||
IconFlag3,
|
||||
IconDots,
|
||||
IconSquareRoundedX,
|
||||
IconTrash,
|
||||
} from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
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 { 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";
|
||||
|
||||
export default function ComponentForum_DetailMoreButton({
|
||||
|
||||
@@ -3,39 +3,30 @@
|
||||
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||
import {
|
||||
Drawer,
|
||||
Stack,
|
||||
Grid,
|
||||
Button,
|
||||
Modal,
|
||||
Title,
|
||||
Group,
|
||||
ActionIcon,
|
||||
Text,
|
||||
Box,
|
||||
Center,
|
||||
Button,
|
||||
Drawer,
|
||||
Grid,
|
||||
Group,
|
||||
Loader,
|
||||
Modal,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useDisclosure, useShallowEffect } from "@mantine/hooks";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import {
|
||||
IconTrash,
|
||||
IconDots,
|
||||
IconEdit,
|
||||
IconFlag3,
|
||||
IconDots,
|
||||
IconSquareRoundedX,
|
||||
IconSquareCheck,
|
||||
IconSquareRoundedX,
|
||||
IconTrash,
|
||||
} from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
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_funDeletePostingById } from "../../fun/delete/fun_delete_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_getAllPostingByAuhtorId } from "../../fun/get/get_list_posting_by_author_id";
|
||||
@@ -277,9 +268,10 @@ function ButtonStatus({
|
||||
async (res) => {
|
||||
if (res.status === 200) {
|
||||
if (userLoginId === authorId) {
|
||||
await forum_getAllPostingByAuhtorId({authorId: authorId, page: 1}).then((val: any) =>
|
||||
setData(val)
|
||||
);
|
||||
await forum_getAllPostingByAuhtorId({
|
||||
authorId: authorId,
|
||||
page: 1,
|
||||
}).then((val: any) => setData(val));
|
||||
} else {
|
||||
await forum_getListAllPosting().then((val) => setData(val as any));
|
||||
}
|
||||
@@ -299,9 +291,10 @@ function ButtonStatus({
|
||||
async (res) => {
|
||||
if (res.status === 200) {
|
||||
if (userLoginId === authorId) {
|
||||
await forum_getAllPostingByAuhtorId({authorId: authorId, page: 1}).then((val: any) =>
|
||||
setData(val)
|
||||
);
|
||||
await forum_getAllPostingByAuhtorId({
|
||||
authorId: authorId,
|
||||
page: 1,
|
||||
}).then((val: any) => setData(val));
|
||||
} else {
|
||||
await forum_getListAllPosting().then((val) => setData(val as any));
|
||||
}
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function forum_countPostingByAuthorId(authorId: string) {
|
||||
|
||||
|
||||
const data = await prisma.forum_Posting.count({
|
||||
where: {
|
||||
authorId: authorId,
|
||||
isActive: true
|
||||
isActive: true,
|
||||
},
|
||||
});
|
||||
|
||||
return data
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
"use server";
|
||||
|
||||
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";
|
||||
|
||||
export async function forum_funCreate(value: string) {
|
||||
const AuthorId = await user_funGetOneUserId();
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
|
||||
const create = await prisma.forum_Posting.create({
|
||||
data: {
|
||||
diskusi: value,
|
||||
authorId: AuthorId,
|
||||
forumMaster_StatusPostingId: 1
|
||||
authorId: userLoginId,
|
||||
forumMaster_StatusPostingId: 1,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
"use server";
|
||||
|
||||
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";
|
||||
|
||||
export async function forum_funCreateKomentar(
|
||||
postingId: string,
|
||||
komentar: string
|
||||
) {
|
||||
const authorId = await user_funGetOneUserId();
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
|
||||
const create = await prisma.forum_Komentar.create({
|
||||
data: {
|
||||
komentar: komentar,
|
||||
forum_PostingId: postingId,
|
||||
authorId: authorId,
|
||||
authorId: userLoginId,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use server";
|
||||
|
||||
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({
|
||||
komentarId,
|
||||
@@ -10,19 +10,12 @@ export async function forum_funCreateReportKomentar({
|
||||
komentarId: string;
|
||||
kategoriId: any;
|
||||
}) {
|
||||
const authorId = await user_funGetOneUserId();
|
||||
// console.log(kategoriId);
|
||||
|
||||
// const cekId = await prisma.forumMaster_KategoriReport.findFirst({
|
||||
// where: {
|
||||
// title: kategoriId,
|
||||
// },
|
||||
// });
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
|
||||
try {
|
||||
const createReport = await prisma.forum_ReportKomentar.create({
|
||||
data: {
|
||||
userId: authorId,
|
||||
userId: userLoginId,
|
||||
forumMaster_KategoriReportId: kategoriId,
|
||||
forum_KomentarId: komentarId,
|
||||
},
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
"use server";
|
||||
|
||||
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(
|
||||
komentarId: string,
|
||||
deskripsi: string
|
||||
) {
|
||||
const authorId = await user_funGetOneUserId();
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
|
||||
const create = await prisma.forum_ReportKomentar.create({
|
||||
data: {
|
||||
forum_KomentarId: komentarId,
|
||||
deskripsi: deskripsi,
|
||||
userId: authorId,
|
||||
userId: userLoginId,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||
|
||||
|
||||
export async function forum_funCreateReportPosting({
|
||||
postingId,
|
||||
@@ -11,11 +11,12 @@ export async function forum_funCreateReportPosting({
|
||||
postingId: string;
|
||||
kategoriId: number;
|
||||
}) {
|
||||
const authorId = await user_funGetOneUserId();
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
|
||||
|
||||
const createReport = await prisma.forum_ReportPosting.create({
|
||||
data: {
|
||||
userId: authorId,
|
||||
userId: userLoginId,
|
||||
forum_PostingId: postingId,
|
||||
forumMaster_KategoriReportId: kategoriId,
|
||||
},
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
"use server";
|
||||
|
||||
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_funCreateReportPostingLainnya(
|
||||
postingId: string,
|
||||
deskripsi: string
|
||||
) {
|
||||
const authorId = await user_funGetOneUserId();
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
const create = await prisma.forum_ReportPosting.create({
|
||||
data: {
|
||||
forum_PostingId: postingId,
|
||||
deskripsi: deskripsi,
|
||||
userId: authorId,
|
||||
userId: userLoginId,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import _ from "lodash";
|
||||
|
||||
export async function forum_getAllPostingByAuhtorId({
|
||||
authorId,
|
||||
|
||||
@@ -37,10 +37,6 @@ export default function Forum_Beranda({
|
||||
const [data, setData] = useState<MODEL_FORUM_POSTING[]>(listForum);
|
||||
const [activePage, setActivePage] = useState(1);
|
||||
const [isSearch, setIsSearch] = useState("");
|
||||
|
||||
const [loadingCreate, setLoadingCreate] = useState(false);
|
||||
|
||||
//
|
||||
const [isNewPost, setIsNewPost] = useState(false);
|
||||
const [countNewPost, setCountNewPost] = useState(0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user