Fix recurring tasks losing name and subtasks on status change (#886)
This commit is contained in:
parent
96db8c1362
commit
edc9d214f6
2 changed files with 12 additions and 7 deletions
|
|
@ -92,13 +92,20 @@ export const updateTask = async (
|
|||
taskUid: string,
|
||||
taskData: Partial<Task>
|
||||
): Promise<Task> => {
|
||||
// Use original_name to prevent display name (e.g. "Monthly", "Daily")
|
||||
// from overwriting the real task name in the database
|
||||
const payload = { ...taskData };
|
||||
if (payload.original_name && payload.name !== undefined) {
|
||||
payload.name = payload.original_name;
|
||||
}
|
||||
|
||||
const response = await fetch(
|
||||
getApiPath(`task/${encodeURIComponent(taskUid)}`),
|
||||
{
|
||||
method: 'PATCH',
|
||||
credentials: 'include',
|
||||
headers: getPostHeaders(),
|
||||
body: JSON.stringify(taskData),
|
||||
body: JSON.stringify(payload),
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue