fixed code so it works for task list in project view

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2026-10-08 01:28:00 +02:00
parent e41932cb9f
commit d2d534cb14
3 changed files with 11 additions and 12 deletions
+1 -5
View File
@@ -111,11 +111,7 @@
show_closed:project.show_closed, show_closed:project.show_closed,
render: false render: false
} }
const resp = await fetch(url,{ const resp = await post(url,data);
credentials : 'include',
method : 'POST',
body : JSON.stringify(data)
});
if (resp.ok){ if (resp.ok){
tasks = {}; tasks = {};
est_time.sum = 0; est_time.sum = 0;
+2 -1
View File
@@ -80,7 +80,8 @@
const url = api('task/list'); const url = api('task/list');
const data = { const data = {
parent_task_id : +task.id, parent_task_id : +task.id,
show_closed : show_closed show_closed : show_closed,
render : false
}; };
if (task.show_closed) data.show_closed = true; if (task.show_closed) data.show_closed = true;
const resp = await post(url,data); const resp = await post(url,data);
@@ -488,11 +488,13 @@ public class TaskModule extends BaseHandler implements TaskService {
projectTasks = addTags(projectTasks, tags); projectTasks = addTags(projectTasks, tags);
return sendContent(ex, mapTasks(projectTasks, render)); return sendContent(ex, mapTasks(projectTasks, render));
} }
if (isSet(parentTaskId)) return sendContent(ex, mapValues(taskDb.listChildrenOf(parentTaskId, user, showClosed))); Map<Long, Task> tasks;
if (!isSet(parentTaskId)) {
var taskIds = json.has(IDS) && json.get(IDS) instanceof JSONArray ids ? ids.toList().stream().map(Object::toString).map(Long::parseLong).toList() : null; var taskIds = json.has(IDS) && json.get(IDS) instanceof JSONArray ids ? ids.toList().stream().map(Object::toString).map(Long::parseLong).toList() : null;
var tasks = taskDb.load(taskIds); if (!isSet(taskIds)) return sendEmptyResponse(HTTP_NOT_IMPLEMENTED,ex);
if (isSet(taskIds)) return sendContent(ex, mapTasks(tasks,render)); tasks = taskDb.load(taskIds);
return sendEmptyResponse(HTTP_NOT_IMPLEMENTED, ex); } else tasks = taskDb.listChildrenOf(parentTaskId,user,showClosed);
return sendContent(ex, mapTasks(tasks,render));
} }
private Map<Long, Task> addTags(Map<Long, Task> taskList, Map<Long, ? extends Collection<String>> tags) { private Map<Long, Task> addTags(Map<Long, Task> taskList, Map<Long, ? extends Collection<String>> tags) {