fix: tasks endpoint response
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user