diff --git a/repositories.manifest b/repositories.manifest index 5fc203e..6d9045d 100644 --- a/repositories.manifest +++ b/repositories.manifest @@ -1,23 +1,23 @@ : 1 -summary: Seafire Resources project repository +summary: Seafire-Resources project repository : role: prerequisite location: https://pkg.cppget.org/1/beta trust: 70:64:FE:E4:E0:F3:60:F1:B4:51:E1:FA:12:5C:E0:B3:DB:DF:96:33:39:B9:2E:E5:C2:68:63:4C:A6:47:39:43 -#: -#role: prerequisite -#location: https://code.helloryan.se/code/libcode-seafire-common.git##HEAD -# -#: -#role: prerequisite -#location: https://code.helloryan.se/code/libcode-seafire-protocol.git##HEAD -# -#: -#role: prerequisite -#location: https://code.helloryan.se/code/libcode-seafire-server.git##HEAD -# -#: -#role: prerequisite -#location: https://code.helloryan.se/code/libcode-seafire-representation.git##HEAD +: +role: prerequisite +location: https://code.helloryan.se/creatures/Seafire-Common.git##HEAD + +: +role: prerequisite +location: https://code.helloryan.se/creatures/Seafire-Protocol.git##HEAD + +: +role: prerequisite +location: https://code.helloryan.se/creatures/Seafire-Server.git##HEAD + +: +role: prerequisite +location: https://code.helloryan.se/creatures/Seafire-Representation.git##HEAD diff --git a/seafire/resources/handle-get.txx b/seafire/resources/handle-get.txx index 6e76142..ab41bd4 100644 --- a/seafire/resources/handle-get.txx +++ b/seafire/resources/handle-get.txx @@ -10,29 +10,9 @@ namespace seafire::resources get_kind_t kind) { auto rep = common::invoke(resource, req, &R::get); + auto selected_rep = representation::select(rep, accepted_type); - auto select = [&]() -> decltype(rep) - { - if constexpr (representation::traits::is_optional_representation_v) { - if (!rep) { - return std::nullopt; - } - - return representation::select(*rep, accepted_type); - } - else { - return representation::select(rep, accepted_type); - } - }; - - auto selected_rep = select(); - - if (!selected_rep) { - res.send(server::common_error_t::not_found); - return; - } - - if (!check_preconditions(req, res, *selected_rep)) + if (!check_preconditions(req, res, selected_rep)) return; namespace rfc7231 = protocol::rfc7231; @@ -55,7 +35,7 @@ namespace seafire::resources status = 201; bool const send_content = kind != get_kind_t::head; - representation::send(req, res, status, *selected_rep, send_content); + representation::send(req, res, status, selected_rep, send_content); } } // namespace seafire::resources diff --git a/seafire/resources/traits.hxx b/seafire/resources/traits.hxx index b8f2618..29c55b5 100644 --- a/seafire/resources/traits.hxx +++ b/seafire/resources/traits.hxx @@ -46,10 +46,6 @@ namespace seafire::resources::traits representation::traits::is_representation_v< typename common::traits::function_traits::return_type > - || - representation::traits::is_optional_representation_v< - typename common::traits::function_traits::return_type - > > { };