mirror of
https://github.com/ershisan99/todolist_next.git
synced 2026-01-30 21:02:05 +00:00
refactor ui
This commit is contained in:
@@ -26,7 +26,7 @@ export const TodolistAPI = {
|
||||
},
|
||||
)
|
||||
|
||||
return handleError(res.data)
|
||||
return res.data
|
||||
},
|
||||
|
||||
async deleteTodolist({ todolistId }: { todolistId: string }) {
|
||||
@@ -60,8 +60,11 @@ export const TodolistAPI = {
|
||||
return res.data
|
||||
},
|
||||
|
||||
async updateTask({ todolistId, task }: { todolistId: string; task: Task }) {
|
||||
const { id, ...rest } = task
|
||||
async updateTask({
|
||||
id,
|
||||
todolistId,
|
||||
...rest
|
||||
}: Partial<Task> & Required<Pick<Task, "id">> & { todolistId: string }) {
|
||||
const res = await todolistApiInstance.patch<UpdateTaskResponse>(
|
||||
`/todolists/${todolistId}/tasks/${id}`,
|
||||
rest,
|
||||
|
||||
Reference in New Issue
Block a user