refactor ui

This commit is contained in:
2024-08-15 14:05:51 +02:00
parent 57c5998435
commit 0ebef3657f
32 changed files with 899 additions and 248 deletions

View File

@@ -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,