Skip to content

Conversation

MiryangJung
Copy link

Description

Delete를 구현했습니다.

Help Wanted 👀

Related Issues

resolve #14
fix #

Checklist ✋

  • PR 타이틀을 {PR type}: {PR title}로 맞췄습니다. (type 예시: feat | fix | BREAKING CHANGE | chore | ci | docs | style | refactor | perf | test) (참고: conventional commits)
  • 모든 변경점들을 확인했으며 적절히 설명했습니다.
  • 빌드와 테스트가 정상적으로 수행됨을 확인했습니다. (npm run build, npm run test)
  • 깃헙 이슈를 연결하겠습니다. (커밋에 resolve #이슈넘버 적거나 PR생성 후 Linked Issue 추가)

@MiryangJung MiryangJung self-assigned this Oct 3, 2021
@MiryangJung MiryangJung changed the title featt Delete feat Delete Oct 3, 2021
return {
...state,
// TODO: todo가 삭제 되었을 때 action.id 값을 이용하여 todos 가 삭제 되도록 수정하기
// todos:
todos: api.getTodos(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 코드에서 보다싶이 api.deleteTodo 함수는 삭제된 결과의 배열을 return 값으로 반환하고 있기 때문에,
굳이 api.getTodos() 호출할 필요 없이 아래처럼 바꾸면 됩니다!

Suggested change
todos: api.getTodos(),
case 'DELETE_TODO':
return {
...state,
todos: api.deleteTodo(action.id),
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

onRemove 구현
2 participants