Tanstack Query - 투두 삭제 기능 만들기
Terminal에서 리액트 앱과 백엔드 서버 가동중인 상태에서 작업하기npm run devnpx json-server server/db.json 삭제 버튼 클릭 후, 백엔드 서버에 데이터 삭제 요청을 전송하여 실제 데이터 삭제하기 - 데이터 삭제 요청을 보내는 비동기 함수 생성src\api\delete-todo.tsimport { API_URL } from "@/lib/constants";import type { Todo } from "@/types";export async function deleteTodo(id: string) { const response = await fetch(`${API_URL}/todos/${id}`, { method: "DELETE", }); if (!respon..