Search

2024๋…„12์›”24์ผ - React Hooks & Router

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