fix: tasks endpoint response

This commit is contained in:
2025-09-23 21:03:13 +02:00
parent 594b5e3af6
commit a9f56c1279
6 changed files with 55 additions and 12 deletions

View File

@@ -36,10 +36,13 @@ void TaskService::registerEndpoints(ApiServer& api) {
}
void TaskService::handleStatusRequest(AsyncWebServerRequest* request) {
TaskStatusResponse response;
// Get task statuses using a separate document to avoid reference issues
JsonDocument scratch;
auto taskStatuses = taskManager.getAllTaskStatuses(scratch);
TaskStatusResponse response;
// Build the complete response with the task data
response.buildCompleteResponse(taskStatuses);
request->send(200, "application/json", response.toJsonString());
}