cpp
This commit is contained in:
11
jtlsrv-cpp/src/endpoints/category.cpp
Normal file
11
jtlsrv-cpp/src/endpoints/category.cpp
Normal file
@@ -0,0 +1,11 @@
|
||||
#include "../http.hpp"
|
||||
#include "../tls_server.hpp"
|
||||
#include "../router.hpp"
|
||||
#include "../queries/category_list.hpp"
|
||||
|
||||
void handle_category(HttpRequest& req, HttpResponse& resp, RouteContext& ctx) {
|
||||
int64_t cursor = std::stoll(req.get_query_param("lastChangedCategory", "0"));
|
||||
int limit = std::stoi(req.get_query_param("limit", "20"));
|
||||
auto categories = get_category_list(cursor, limit);
|
||||
resp.send_json(200, categories);
|
||||
}
|
||||
Reference in New Issue
Block a user