implemented deletion of times
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -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)}>
|
||||
|
||||
Reference in New Issue
Block a user