implemented deletion of times

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-08-28 23:19:59 +02:00
parent b8428a2352
commit 9fa89fbb3b
7 changed files with 81 additions and 4 deletions

View File

@@ -64,6 +64,24 @@
}
}
function onAbort(){
detail = null;
}
async function onDrop(time_id){
const url = api(`time/${time_id}`);
const res = await fetch(url,{
credentials:'include',
method:'DELETE'
});
if (res.ok){
delete times[time_id];
error = false;
} else {
error = await res.text();
}
}
function openTask(tid){
router.navigate(`/task/${tid}/view`);
}
@@ -148,7 +166,7 @@
{/if}
{#if detail == time.id}
<td colspan="5">
<TimeEditor record={time} onSet={update} />
<TimeEditor record={time} {onAbort} {onDrop} onSet={update} />
</td>
{:else}
<td class="start_end" onclick={e => toggleSelect(time.id)}>