implemented unlinking task from parent task

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-10-18 14:08:54 +02:00
parent 472fa147de
commit 7ca3445c31
2 changed files with 11 additions and 2 deletions

View File

@@ -140,6 +140,10 @@
showSettings = !showSettings;
}
function unlink_parent(){
update({parent_task_id:null});
}
async function update(data){
const url = api(`task/${id}`);
const resp = await fetch(url,{
@@ -151,7 +155,11 @@
yikes();
let old_task = task;
task = await resp.json();
if (task.parent_id == old_task.parent_id) task.parent = old_task.parent;
if (!task.parent_id){
task.parent = null;
} else {
if (task.parent_id == old_task.parent_id) task.parent = old_task.parent;
}
return true;
} else {
error(resp);
@@ -196,6 +204,7 @@
<div>{t('parent_task')}</div>
<div class="parent">
<a href="#" onclick={gotoParent}>{task.parent.name}</a>
<button class="symbol" title={t('unlink')} onclick={unlink_parent}></button>
</div>
{/if}
<div>{t('task')}</div>