Skip to content

Commit 3825b24

Browse files
committed
fix: 포스트 수정시 메모 사라지는 이슈 수정
기존 memo 유지될수 있도록 updatePost 시 memo 전달
1 parent 6ca1fac commit 3825b24

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

components/post/post-editor.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ interface PostEditorProps {
4040

4141
const PostEditor: FunctionComponent<PostEditorProps> = ({ id, status }) => {
4242
const {
43-
data: { content, title, tagList, archiveId },
43+
data: { content, title, tagList, archiveId, memoContent },
4444
} = usePostDetail({ id, status });
4545
const { mutate: updatePostMutate } = useUpdatePostMutation();
4646
const tagListRef = useRef<{ getTagList: () => string[] }>(null);
@@ -86,8 +86,8 @@ const PostEditor: FunctionComponent<PostEditorProps> = ({ id, status }) => {
8686
title: getValues('title'),
8787
content: editorRef.current?.getMarkdown().trim() ?? '',
8888
tagList: tagListRef.current?.getTagList() ?? [],
89-
memo: null,
90-
archiveId: archiveId === -1 ? null : archiveId,
89+
memo: memoContent,
90+
archiveId: archiveId === -1 ? undefined : archiveId,
9191
},
9292
},
9393
{

types/post-types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ export interface UpdatePostBody {
3434
content: string;
3535
title: string;
3636
tagList: string[];
37-
archiveId: number | null;
38-
memo: string | null;
37+
archiveId?: number;
38+
memo?: string;
3939
}
4040

4141
export interface FetchPostsRequest {

0 commit comments

Comments
 (0)