Fix recurring tasks losing name and subtasks on status change (#886)

This commit is contained in:
Chris 2026-03-01 13:17:54 +02:00 committed by GitHub
parent 96db8c1362
commit edc9d214f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 7 deletions

View file

@ -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),
}
);