avoiding markdown rendering when loading project tasks

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2026-10-08 00:59:58 +02:00
parent d95f4359f0
commit e41932cb9f
3 changed files with 7 additions and 6 deletions
@@ -475,23 +475,23 @@ public class TaskModule extends BaseHandler implements TaskService {
var noIndex = json.has(NO_INDEX) && json.get(NO_INDEX) instanceof Boolean bool ? bool : false;
var projectId = json.has(PROJECT_ID) && json.get(PROJECT_ID) instanceof Number number ? number.longValue() : null;
var parentTaskId = json.has(PARENT_TASK_ID) && json.get(PARENT_TASK_ID) instanceof Number number ? number.longValue() : null;
var markdown = !json.has(RENDERED) || !(json.get(RENDERED) instanceof Boolean render) || render;
var render = !json.has(RENDER) || !(json.get(RENDER) instanceof Boolean bool) || bool;
if (isSet(projectId)) {
if (parentTaskId == null) {
var list = taskDb.listRootTasks(projectId, user, showClosed);
return sendContent(ex, mapTasks(list,markdown));
return sendContent(ex, mapTasks(list,render));
}
var projectTasks = taskDb.listProjectTasks(projectId, parentTaskId, noIndex);
loadMembers(projectTasks.values());
var tags = tagService().getTags(TASK,projectTasks.keySet(),user);
projectTasks = addTags(projectTasks, tags);
return sendContent(ex, mapTasks(projectTasks, markdown));
return sendContent(ex, mapTasks(projectTasks, render));
}
if (isSet(parentTaskId)) return sendContent(ex, mapValues(taskDb.listChildrenOf(parentTaskId, user, showClosed)));
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,markdown));
if (isSet(taskIds)) return sendContent(ex, mapTasks(tasks,render));
return sendEmptyResponse(HTTP_NOT_IMPLEMENTED, ex);
}