# Forum Created
## feat - CRUD Forum - CRD Koment - Tampilan forum profile ### No issue
This commit is contained in:
@@ -1,11 +1,22 @@
|
||||
import Forum_Detail from "@/app_modules/forum/detail";
|
||||
import { forum_getKomentarById } from "@/app_modules/forum/fun/get/get_komentar_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";
|
||||
|
||||
export default async function Page({params}: {params: {id: string}}) {
|
||||
let forumId = params.id
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let postingId = params.id;
|
||||
const dataPosting = await forum_getOnePostingById(postingId);
|
||||
const listKomentar = await forum_getKomentarById(postingId);
|
||||
const totalKomentar = await forum_countOneTotalKomentarById(postingId)
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<Forum_Detail forumId={forumId} />
|
||||
<Forum_Detail
|
||||
dataPosting={dataPosting as any}
|
||||
listKomentar={listKomentar as any}
|
||||
totalKomentar={totalKomentar}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
import { Forum_EditPosting } from "@/app_modules/forum";
|
||||
import { forum_getOnePostingById } from "@/app_modules/forum/fun/get/get_one_posting_by_id";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let postingId = params.id;
|
||||
const dataPosting = await forum_getOnePostingById(postingId)
|
||||
|
||||
export default async function Page() {
|
||||
return (
|
||||
<>
|
||||
<Forum_EditPosting />
|
||||
<Forum_EditPosting dataPosting={dataPosting as any} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,10 +5,12 @@ import React from "react";
|
||||
|
||||
export default async function Layout({
|
||||
children,
|
||||
params,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
params: { id: string };
|
||||
}) {
|
||||
const authorId = await User_getUserId();
|
||||
const authorId = params.id;
|
||||
const dataAuthor = await user_getOneById(authorId);
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
import { Forum_Forumku } from "@/app_modules/forum";
|
||||
import { forum_getListPostingByAuhtorId } 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_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneById } from "@/app_modules/home/fun/get/get_one_user_by_id";
|
||||
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 } }) {
|
||||
const authorId = params.id;
|
||||
const userLoginId = await User_getUserId()
|
||||
const dataAuthor = await user_getOneById(authorId);
|
||||
const auhtorSelectedData = _.omit(dataAuthor, [
|
||||
"Profile.email",
|
||||
@@ -21,9 +25,20 @@ export default async function Page({ params }: { params: { id: string } }) {
|
||||
// setTimeout(a, 1000);
|
||||
// });
|
||||
|
||||
|
||||
|
||||
const dataPosting = await forum_getListPostingByAuhtorId(authorId);
|
||||
const totalPosting = await forum_countPostingByAuthorId(authorId);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Forum_Forumku auhtorSelectedData={auhtorSelectedData as any} />
|
||||
|
||||
<Forum_Forumku
|
||||
auhtorSelectedData={auhtorSelectedData as any}
|
||||
dataPosting={dataPosting as any}
|
||||
totalPosting={totalPosting}
|
||||
userLoginId={userLoginId as any}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import { Forum_Komentar } from "@/app_modules/forum";
|
||||
import { forum_getOnePostingById } from "@/app_modules/forum/fun/get/get_one_posting_by_id";
|
||||
|
||||
export default async function Page({params}: {params: {id: string}}) {
|
||||
let forumId = params.id
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let postingId = params.id;
|
||||
const dataPosting = await forum_getOnePostingById(postingId);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Forum_Komentar forumId={forumId} />
|
||||
<Forum_Komentar dataPosting={dataPosting as any} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
import { Forum_Beranda } from "@/app_modules/forum";
|
||||
import { forum_getListAllPosting } from "@/app_modules/forum/fun/get/get_list_all_posting";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function Page() {
|
||||
|
||||
const listForum = await forum_getListAllPosting();
|
||||
// console.log(listForum);
|
||||
return (
|
||||
<>
|
||||
<Forum_Beranda />
|
||||
<Forum_Beranda listForum={listForum as any} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user