-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FE] 어드민 페이지에 아티클 수정 기능을 추가한다. #1081
base: dev-fe
Are you sure you want to change the base?
Conversation
현재 서버측에서 노션에 적힌 PUT 메소드와 달리 허용 가능한 메서드를 GET, DELETE 만 설정해놔서 문의해놨습니다~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
헤일리 여행갔다 오셔서 피곤하실텐데 빠르게 작업해주셔서 고맙습니다!! 역시 헤일리👍👍 수고하셨어요!!
import DesktopLayout from '@/components/_common/layout/DesktopLayout'; | ||
import useGetArticleQuery from '@/hooks/query/useGetArticleQuery'; | ||
import usePutArticleQuery from '@/hooks/query/usePutArticleQuery'; | ||
import useArticleForm from '@/hooks/useArticleForm'; // 커스텀 훅 임포트 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 주석은 왜 넣으신 것일까요??
|
||
const handleSubmit = () => { | ||
editArticle({ | ||
article: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
데이터 구조가 똑같애서 form 자체를 넣는 것도 나쁘지 않다는 생각이 드는데, 이정도는 그냥 진행하셔도 무방할듯도 하네요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
반영 완~!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다 헤일리
const [content, setContent] = useState('# 여기에 아티클을 작성해주세요'); | ||
|
||
const NewArticlePage = () => { | ||
const { form, setField } = useArticleForm(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
input값들을 하나의 객체로 관리하기위한 커스텀훅 useInputs
가 이미 있는데, 이걸 사용하면 어떨까요. 코드도 더 간결해질거에요. 적용을 해주셔도좋고, 안해주셔도 괜찮아요.
const {values:form, onChange} = useInputs<ArticlePostForm>({
title: '',
keyword: '',
summary: '',
thumbnail: '',
content: '# 여기에 아티클을 작성해주세요',
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 만들어져있고 한번도 사용안된 훅이 있었네열 반영해서 사용해봤습니다~
❗ Issue
✨ 구현한 기능
아티클 수정 에디터 추가
어드민 페이지에서 아티클 수정 기능을 추가했습니다.
어드민 페이지에서 수정하기 버튼 클릭 시 아티클 리스트를 볼 수 있고 내부에서 수정하고 싶은 아티클을 선택해서 수정하시면 됩니다~
📢 논의하고 싶은 내용
🎸 기타