2024๋ 12์24์ผ - React
Hooks
ToDoList
ํ ์ผ ๋ชฉ๋ก ์กฐํ
ํ์ด์ง
์ธํผ๋ํฐ ์คํฌ๋กค
์คํฌ๋กค ์ด๋ฒคํธ ์ฒ๋ฆฌ
ํ ์ผ ๋ชฉ๋ก ๋ค์ ํ์ด์ง ์์ฒญ
/todos?page={page}
์๋ก ์ถ๊ฐ๋ ๋ฆฌ์คํธ์ [์์ ][์ญ์ ] ์ ๊ฐฑ์ ์๋จ
sweetalert2 ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ ์ฉ
ํ ์ผ ์๋ฃ ์ฒ๋ฆฌ
ํ ์ผ ์ญ์
์ ์ฒด์๋ฃ & ์ ์ฒด ์ญ์
์ ์ฒด ์๋ฃ
(Back) ์ ์ฒด ์๋ฃ UPDATE ๋ฌธ
id=โcompleteAllโ
Mapper
completeAll()
Service
completeAll
Controller
[PUT] /todos
id๊ฐ null ์ธ ๊ฒฝ์ฐ
์ ์ฒด์๋ฃ
body : { id: null, name: null, status: true }
์ ์ฒด ์ญ์
(Back) ์ ์ฒด ์๋ฃ DELETE ๋ฌธ
id=โdeleteAllโ
Mapper
deleteAll()
Service
deleteAll
Controller
[DELETE] /todos
id๊ฐ null ์ธ ๊ฒฝ์ฐ
์ ์ฒด์ญ์
body : { id: null }
Router