|
@ -1,3 +1,7 @@ |
|
|
|
|
|
<script lang="ts" context="module"> |
|
|
|
|
|
let lastProjectId = ""; |
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
<script lang="ts"> |
|
|
<script lang="ts"> |
|
|
import stuffLogClient from "../clients/stufflog"; |
|
|
import stuffLogClient from "../clients/stufflog"; |
|
|
import Modal from "../components/Modal.svelte"; |
|
|
import Modal from "../components/Modal.svelte"; |
|
@ -20,7 +24,7 @@ |
|
|
taskId = md.task.id; |
|
|
taskId = md.task.id; |
|
|
verb = "Delete"; |
|
|
verb = "Delete"; |
|
|
} else if (md.name === "tasklink.add") { |
|
|
} else if (md.name === "tasklink.add") { |
|
|
projectId = (md.project||{id:""}).id; |
|
|
|
|
|
|
|
|
projectId = (md.project||{id:""}).id || lastProjectId; |
|
|
taskId = (md.task||{id:""}).id; |
|
|
taskId = (md.task||{id:""}).id; |
|
|
} else { |
|
|
} else { |
|
|
throw new Error(`Wrong form ${md.name}`) |
|
|
throw new Error(`Wrong form ${md.name}`) |
|
@ -41,6 +45,7 @@ |
|
|
error = err.message ? err.message : err.toString(); |
|
|
error = err.message ? err.message : err.toString(); |
|
|
}).finally(() => { |
|
|
}).finally(() => { |
|
|
loading = false; |
|
|
loading = false; |
|
|
|
|
|
lastProjectId = projectId; |
|
|
}) |
|
|
}) |
|
|
} else if (deletion) { |
|
|
} else if (deletion) { |
|
|
stuffLogClient.deleteTaskLink(projectId, taskId).then(() => { |
|
|
stuffLogClient.deleteTaskLink(projectId, taskId).then(() => { |
|
@ -50,6 +55,7 @@ |
|
|
error = err.message ? err.message : err.toString(); |
|
|
error = err.message ? err.message : err.toString(); |
|
|
}).finally(() => { |
|
|
}).finally(() => { |
|
|
loading = false; |
|
|
loading = false; |
|
|
|
|
|
lastProjectId = projectId; |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|