Update src/server.cpp
This commit is contained in:
@@ -353,10 +353,13 @@ void Server::handle_get_directory(const drogon::HttpRequestPtr& /*req*/, std::fu
|
||||
}
|
||||
|
||||
// output the labeltags as an array of label:tag pairs
|
||||
// Filter out entries that have no labeltags
|
||||
nlohmann::json entries_array = nlohmann::json::array();
|
||||
for (const auto& entry : entries) {
|
||||
if (!entry.labeltags.empty()) {
|
||||
entries_array.push_back({{"labeltags", entry.labeltags}, {"hash", entry.hash}});
|
||||
}
|
||||
}
|
||||
|
||||
auto resp = drogon::HttpResponse::newHttpResponse();
|
||||
nlohmann::json response = {{"result", "success"}, {"entries", entries_array}};
|
||||
|
Reference in New Issue
Block a user