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:
@@ -111,11 +111,7 @@
|
||||
show_closed:project.show_closed,
|
||||
render: false
|
||||
}
|
||||
const resp = await fetch(url,{
|
||||
credentials : 'include',
|
||||
method : 'POST',
|
||||
body : JSON.stringify(data)
|
||||
});
|
||||
const resp = await post(url,data);
|
||||
if (resp.ok){
|
||||
tasks = {};
|
||||
est_time.sum = 0;
|
||||
|
||||
@@ -80,7 +80,8 @@
|
||||
const url = api('task/list');
|
||||
const data = {
|
||||
parent_task_id : +task.id,
|
||||
show_closed : show_closed
|
||||
show_closed : show_closed,
|
||||
render : false
|
||||
};
|
||||
if (task.show_closed) data.show_closed = true;
|
||||
const resp = await post(url,data);
|
||||
|
||||
@@ -488,11 +488,13 @@ public class TaskModule extends BaseHandler implements TaskService {
|
||||
projectTasks = addTags(projectTasks, tags);
|
||||
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 tasks = taskDb.load(taskIds);
|
||||
if (isSet(taskIds)) return sendContent(ex, mapTasks(tasks,render));
|
||||
return sendEmptyResponse(HTTP_NOT_IMPLEMENTED, ex);
|
||||
if (!isSet(taskIds)) return sendEmptyResponse(HTTP_NOT_IMPLEMENTED,ex);
|
||||
tasks = taskDb.load(taskIds);
|
||||
} 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) {
|
||||
|
||||
Reference in New Issue
Block a user