diff --git a/src/pages/audit/auditPatch/hook/useAuditPatch.ts b/src/pages/audit/auditPatch/hook/useAuditPatch.ts index cb45a250..6d8a2959 100644 --- a/src/pages/audit/auditPatch/hook/useAuditPatch.ts +++ b/src/pages/audit/auditPatch/hook/useAuditPatch.ts @@ -25,7 +25,7 @@ export function useAuditPatch() { const [thumbnailImage, setThumbnailImage] = useState(imageList[0] ?? ''); const [title, setTitle] = useState(postDetail?.title ?? ''); - const [category, setCategory] = useState(postDetail?.categoryName ?? ''); + const [category, setCategory] = useState(postDetail?.category ?? ''); const [content, setContent] = useState(postDetail?.content ?? ''); const [deletedFiles, setDeletedFiles] = useState([]); const [newFiles, setNewFiles] = useState([]); diff --git a/src/pages/human-rights/edit/page.tsx b/src/pages/human-rights/edit/page.tsx index a6991149..9b4059ea 100644 --- a/src/pages/human-rights/edit/page.tsx +++ b/src/pages/human-rights/edit/page.tsx @@ -490,7 +490,7 @@ export function HumanRightsEditPage() { titleError ? 'h-5 translate-y-0 opacity-100' : 'h-0 -translate-y-2 opacity-0' )} > - 이 값은 필수입니다. + {titleError && titleError.type === 'too_big' ? '제목은 50자 이내이여야 합니다.' : '이 값은 필수입니다.'}

(postDetail?.title ?? ''); - const [category, setCategory] = useState(postDetail?.categoryName ?? ''); + const [category, setCategory] = useState(postDetail?.category ?? ''); const [content, setContent] = useState(postDetail?.content ?? ''); const imageList = postDetail?.fileResponseList?.filter((file) => file.fileType === 'images').map((file) => file.fileUrl) || []; diff --git a/src/pages/partnership/partnershipPatch/hook/usePartnershipPatch.ts b/src/pages/partnership/partnershipPatch/hook/usePartnershipPatch.ts index 845de5b6..c1b2871d 100644 --- a/src/pages/partnership/partnershipPatch/hook/usePartnershipPatch.ts +++ b/src/pages/partnership/partnershipPatch/hook/usePartnershipPatch.ts @@ -26,7 +26,7 @@ export function usePartnershipPatch() { const [thumbnailImage, setThumbnailImage] = useState(imageList[0] ?? ''); const [title, setTitle] = useState(postDetail?.title ?? ''); - const [category, setCategory] = useState(postDetail?.categoryName ?? ''); + const [category, setCategory] = useState(postDetail?.category ?? ''); const [content, setContent] = useState(postDetail?.content ?? ''); const [deletedFiles, setDeletedFiles] = useState([]); const [newFiles, setNewFiles] = useState([]); diff --git a/src/pages/petition-notice/[id]/containers/PostPetitionDetailPostSection.tsx b/src/pages/petition-notice/[id]/containers/PostPetitionDetailPostSection.tsx index b4f4b5e2..12e596bb 100644 --- a/src/pages/petition-notice/[id]/containers/PostPetitionDetailPostSection.tsx +++ b/src/pages/petition-notice/[id]/containers/PostPetitionDetailPostSection.tsx @@ -164,7 +164,7 @@ export function PostPetitionDetailPostSection() {
- +
diff --git a/src/pages/petition-notice/edit/containers/PetitionNoticeEditorSection.tsx b/src/pages/petition-notice/edit/containers/PetitionNoticeEditorSection.tsx index 16ec5757..f71a9da6 100644 --- a/src/pages/petition-notice/edit/containers/PetitionNoticeEditorSection.tsx +++ b/src/pages/petition-notice/edit/containers/PetitionNoticeEditorSection.tsx @@ -14,7 +14,7 @@ import { usePostBoardPosts } from '@/hooks/api/post/usePostBoardPosts'; import { GUIDE_LINE } from '../components/GuideLine'; import { useDelBoardFiles } from '@/hooks/api/del/useDelBoardFiles'; import { HookMap } from '@toast-ui/editor'; - +import { GetBoardDetailResponse } from '@/types/apis/get'; export function PetitionNoticeEditorSection() { const titleRef = useRef(null); @@ -28,19 +28,19 @@ export function PetitionNoticeEditorSection() { const navigate = useNavigate(); const oldContent = localStorage.getItem('oldContent')!; - const parsedContent = JSON.parse(oldContent); + const parsedContent = JSON.parse(oldContent) as GetBoardDetailResponse['data']; useEffect(() => { if (parsedContent) { const postDetailResDto = parsedContent.postDetailResDto; setInitialTitle(postDetailResDto.title); setInitialContent(JSON.parse(postDetailResDto.content)); - setInitialCategoryName(postDetailResDto.categoryName); + setInitialCategoryName(postDetailResDto.category); setIsEditing(true); } setLoading(false); - }, []); + }, [parsedContent]); const handleTitleChange = (e: React.ChangeEvent) => { if (e.target.value.length <= 50) { diff --git a/src/types/apis/get/index.tsx b/src/types/apis/get/index.tsx index be942f46..71bb6a12 100644 --- a/src/types/apis/get/index.tsx +++ b/src/types/apis/get/index.tsx @@ -39,7 +39,7 @@ export interface FileResponse { export interface PostDetailResDto { postId: number; - categoryName: string; + category: string; authorName: string; allowedAuthorities: string[]; title: string;