diff --git a/src/endpoints_handlers/PostUserMedicationsExecutor.h b/src/endpoints_handlers/PostUserMedicationsExecutor.h index 0d06af8..3e69e36 100644 --- a/src/endpoints_handlers/PostUserMedicationsExecutor.h +++ b/src/endpoints_handlers/PostUserMedicationsExecutor.h @@ -14,13 +14,13 @@ namespace uad { template -class GetUserMedicationsExecutor : public IExecutor +class PostUserMedicationsExecutor : public IExecutor { mysqlx::Session& session_; const std::shared_ptr& auth_dao_; const std::shared_ptr& medications_dao_; public: - GetUserMedicationsExecutor( + PostUserMedicationsExecutor( mysqlx::Session& session, const std::shared_ptr& auth_dao, const std::shared_ptr& medications_dao diff --git a/src/endpoints_handlers/RootExecutor.h b/src/endpoints_handlers/RootExecutor.h index be3c272..6b396f8 100644 --- a/src/endpoints_handlers/RootExecutor.h +++ b/src/endpoints_handlers/RootExecutor.h @@ -8,6 +8,7 @@ #include "AuthLoginExecutor.h" #include "AuthLogoutExecutor.h" #include "GetUserMedicationsExecutor.h" +#include "PostUserMedicationsExecutor.h" #include "../DAO/IUserDAO.h" #include "../DAO/IAuthDAO.h" #include "../DAO/IMedicationsDAO.h" @@ -28,6 +29,8 @@ class RootExecutor Body, Allocator, boost::beast::http::string_body>; using RouteUserGetMedicationsExecutor = GetUserMedicationsExecutor< Body, Allocator, boost::beast::http::string_body>; + using RouteUserPostMedicationsExecutor = PostUserMedicationsExecutor< + Body, Allocator, boost::beast::http::string_body>; using IRouteController = IController; using RouteController = Controller; using RoutesPathes = std::unordered_map>; @@ -85,7 +88,11 @@ public: { boost::beast::http::verb::get, std::make_shared(session_, auth_dao_, medications_dao_) - } + }, + { + boost::beast::http::verb::post, + std::make_shared(session_, auth_dao_, medications_dao_) + }, } ); }