squash! server : add handle_slot_type lambda
Rename handle_slot_type to handle_slot_impl.
This commit is contained in:
parent
c5825e76ec
commit
7c34af40fb
1 changed files with 5 additions and 5 deletions
|
@ -3665,7 +3665,7 @@ int main(int argc, char ** argv) {
|
||||||
res.status = 200; // HTTP OK
|
res.status = 200; // HTTP OK
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto handle_slot_type = [&ctx_server, &res_error, &res_ok, ¶ms](const httplib::Request & req,
|
const auto handle_slot_impl = [&ctx_server, &res_error, &res_ok, ¶ms](const httplib::Request & req,
|
||||||
httplib::Response & res, int id_slot, server_task_type type) {
|
httplib::Response & res, int id_slot, server_task_type type) {
|
||||||
json request_data = json::parse(req.body);
|
json request_data = json::parse(req.body);
|
||||||
std::string filename = request_data.at("filename");
|
std::string filename = request_data.at("filename");
|
||||||
|
@ -3698,12 +3698,12 @@ int main(int argc, char ** argv) {
|
||||||
res_ok(res, result->to_json());
|
res_ok(res, result->to_json());
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto handle_slots_save = [&handle_slot_type](const httplib::Request & req, httplib::Response & res, int id_slot) {
|
const auto handle_slots_save = [&handle_slot_impl](const httplib::Request & req, httplib::Response & res, int id_slot) {
|
||||||
handle_slot_type(req, res, id_slot, SERVER_TASK_TYPE_SLOT_SAVE);
|
handle_slot_impl(req, res, id_slot, SERVER_TASK_TYPE_SLOT_SAVE);
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto handle_slots_restore = [&handle_slot_type](const httplib::Request & req, httplib::Response & res, int id_slot) {
|
const auto handle_slots_restore = [&handle_slot_impl](const httplib::Request & req, httplib::Response & res, int id_slot) {
|
||||||
handle_slot_type(req, res, id_slot, SERVER_TASK_TYPE_SLOT_RESTORE);
|
handle_slot_impl(req, res, id_slot, SERVER_TASK_TYPE_SLOT_RESTORE);
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto handle_slots_erase = [&ctx_server, &res_error, &res_ok](const httplib::Request & /* req */, httplib::Response & res, int id_slot) {
|
const auto handle_slots_erase = [&ctx_server, &res_error, &res_ok](const httplib::Request & /* req */, httplib::Response & res, int id_slot) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue