#include "../http.hpp"
#include "../tls_server.hpp"
#include "../router.hpp"
#include "../queries/deleted_entity_list.hpp"

void handle_deleted_entity(HttpRequest& req, HttpResponse& resp, RouteContext& /*ctx*/) {
    int64_t cursor = std::stoll(req.get_query_param("lastChangedDeletedEntity", "0"));
    int limit = std::stoi(req.get_query_param("limit", "600"));
    auto deleted = get_deleted_entity_list(cursor, limit);
    resp.send_json(200, deleted);
}
