feat: 페이지 권한 처리 작업

This commit is contained in:
2025-05-08 09:05:06 +09:00
parent 041b59e498
commit 3ae4504128
6 changed files with 75 additions and 13 deletions
@@ -22,12 +22,15 @@ import {
} from "@common/components";
import { PostApi, type Post, type PostParams } from "@/entities/post";
import { ENDPOINT } from "@/shared/config";
import { useMenuStore } from "@/shared/lib";
import { columns } from "../model/notice-table-columns";
import { NoticeLayout } from "./notice-layout";
function NoticePage({ bbsId }: { bbsId: string }) {
const router = useRouter();
const pathname = usePathname();
const { pageMenuAuthority } = useMenuStore((state) => state);
const [rowSelection, setRowSelection] = useState<RowSelectionState>({});
const [postParams, setPostParams] = useState<PostParams>({
keywordType: "title",
@@ -82,7 +85,7 @@ function NoticePage({ bbsId }: { bbsId: string }) {
<div className="card card-border !mt-6">
<div className="card card-border">
<form onSubmit={handleSubmit} className="flex items-center gap-2 p-2">
<Label className="text-label">검색</Label>
<Label className="mr-2 text-label">검색</Label>
<Select
value={postParams.keywordType}
onValueChange={(keywordType) => {
@@ -115,9 +118,11 @@ function NoticePage({ bbsId }: { bbsId: string }) {
<div className="flex w-full items-center justify-between">
<h3 className="text-2xl font-medium text-label">공지사항 목록</h3>
<div className="flex gap-2">
<Button onClick={() => router.push(`${pathname}/register`)}>
등록
</Button>
{pageMenuAuthority?.regAuthrtYn === "Y" && (
<Button onClick={() => router.push(`${pathname}/register`)}>
등록
</Button>
)}
<Select
value={table.getState().pagination.pageSize.toString()}
onValueChange={(value) => {