mirror of
https://github.com/TurTaskProject/TurTaskWeb.git
synced 2025-12-19 05:54:07 +01:00
Add update partial of task (patch api)
This commit is contained in:
parent
b7bb101759
commit
9affc1ecba
@ -38,6 +38,15 @@ export const updateTask = (endpoint, id, data) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const updateTaskPartial = (endpoint, id, data) => {
|
||||||
|
return axiosInstance
|
||||||
|
.patch(`${baseURL}${endpoint}/${id}/`, data)
|
||||||
|
.then((response) => response.data)
|
||||||
|
.catch((error) => {
|
||||||
|
throw error;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
export const deleteTask = (endpoint, id) => {
|
export const deleteTask = (endpoint, id) => {
|
||||||
return axiosInstance
|
return axiosInstance
|
||||||
.delete(`${baseURL}${endpoint}/${id}/`)
|
.delete(`${baseURL}${endpoint}/${id}/`)
|
||||||
@ -64,6 +73,7 @@ export const readHabitTaskByID = (id) => readTaskByID("habit", id);
|
|||||||
|
|
||||||
// Update
|
// Update
|
||||||
export const updateTodoTask = (id, data) => updateTask("todo", id, data);
|
export const updateTodoTask = (id, data) => updateTask("todo", id, data);
|
||||||
|
export const updateTodoTaskPartial = (id, data) => updateTaskPartial("todo", id, data);
|
||||||
export const updateRecurrenceTask = (id, data) => updateTask("daily", id, data);
|
export const updateRecurrenceTask = (id, data) => updateTask("daily", id, data);
|
||||||
export const updateHabitTask = (id, data) => updateTask("habit", id, data);
|
export const updateHabitTask = (id, data) => updateTask("habit", id, data);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user