Browse Source

fixed addTime in task view

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
feature/join_times
Stephan Richter 2 months ago
parent
commit
b8428a2352
  1. 9
      frontend/src/routes/task/View.svelte

9
frontend/src/routes/task/View.svelte

@ -5,6 +5,7 @@
import { api } from '../../urls.svelte.js'; import { api } from '../../urls.svelte.js';
import { t } from '../../translations.svelte.js'; import { t } from '../../translations.svelte.js';
import { timetrack } from '../../user.svelte.js'; import { timetrack } from '../../user.svelte.js';
import { now } from '../../time.svelte';
import LineEditor from '../../Components/LineEditor.svelte'; import LineEditor from '../../Components/LineEditor.svelte';
import MarkdownEditor from '../../Components/MarkdownEditor.svelte'; import MarkdownEditor from '../../Components/MarkdownEditor.svelte';
@ -36,8 +37,12 @@
} }
async function addTime(){ async function addTime(){
const url = api(`time/track_task/${id}`); const url = api(`time/track_task/${task.id}`);
const resp = await fetch(url,{credentials:'include'}); // create new time or return time with assigned tasks const resp = await fetch(url,{
credentials : 'include',
method : 'POST',
body : now()
}); // create new time or return time with assigned tasks
if (resp.ok) { if (resp.ok) {
const track = await resp.json(); const track = await resp.json();
timetrack.running = track; timetrack.running = track;

Loading…
Cancel
Save