-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: #7 Todo 리스트 구현 #13
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
5 tasks
SeungrokYoon
force-pushed
the
feat/#7-todo
branch
from
August 24, 2023 06:48
c69b640
to
74e392e
Compare
SeungrokYoon
force-pushed
the
feat/#7-todo
branch
from
August 24, 2023 06:52
74e392e
to
c2278ca
Compare
SeungrokYoon
requested changes
Aug 24, 2023
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.
저도 함께 화면공유를 통해 개발에 간접적으로 참여한 컴포넌트라 로직이 잘 이해가 되었습니다.
고생하셨습니다!
wisdomin121
reviewed
Aug 24, 2023
SeungrokYoon
approved these changes
Aug 24, 2023
Co-Authored-By: 이선근 <[email protected]>
Co-Authored-By: 이선근 <[email protected]>
Co-Authored-By: 이선근 <[email protected]>
Co-Authored-By: 이선근 <[email protected]>
Co-Authored-By: 이선근 <[email protected]>
salmontaker
force-pushed
the
feat/#7-todo
branch
from
August 24, 2023 11:16
1670caa
to
dfb599b
Compare
wisdomin121
approved these changes
Aug 24, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Todo 페이지의 기능을 구현하였습니다.
@5unk3n 님과 함께 LiveShare로 페어 프로그래밍을 하였습니다!
Changes
TODO CRUD에 필요한 api를 작성하였습니다.
/todo 페이지에서 Todo를 추가, 조회, 수정, 삭제를 할 수 있도록 구현하였습니다.
TODO 조회
Todo의 type을 위와 같이 정의하였고,
get
요청 성공시, 서버로부터 받아온 값을 todos에useState<TodoType[]>([])
로 저장하였습니다.또한,
map()
을 사용하여 Todo 리스트의 내용을 렌더링 하였습니다.input의
onChange
value를 newTodo에useState('')
로 저장하였고, 추가 버튼을 누르면 서버로post
요청을 보냅니다.post
요청 성공시, 해당 값을 Spread를 사용하여 todos에 추가 하도록 하였습니다.isEditMode
상태에 따라 렌더링 요소를 결정하고, 수정 버튼을 통해 토글합니다.제출 버튼 클릭 시 TodoList 컴포넌트에서 prop으로 받은
updateTodo
함수를 실행합니다.put
요청 성공시 todos에서 같은 id를 가진 todo를 변경하도록 했습니다.삭제 버튼 클릭 시 TodoList에서 prop으로 받은
deleteTodo
함수를 실행합니다.delete
요청 성공 시 todos에서.filter()
메서드를 사용해 같은 id를 가진 todo를 삭제하도록 했습니다.todo의 완료 여부는
todoCheck
상태로 결정됩니다.TODO 수정 기능과 같이
updateTodo
함수를 사용하며todoCheck
를 not 연산자로 변경해 요청합니다.