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