| 708 | } |
| 709 | |
| 710 | MeasureManagerServer::ResponseType MeasureManagerServer::set(const web::json::value& body) { |
| 711 | if (auto p_ = get_field<openstudio::path>(body, "my_measures_dir")) { |
| 712 | if (!openstudio::filesystem::is_directory(*p_)) { |
| 713 | // Issue an error message |
| 714 | return {web::http::status_codes::BadRequest, |
| 715 | toWebJSON(fmt::format("Error, my_measures_dir '{}' is a not a valid directory", p_->generic_string()))}; |
| 716 | } |
| 717 | this->my_measures_dir = std::move(*p_); |
| 718 | return {web::http::status_codes::OK, web::json::value()}; |
| 719 | } else { |
| 720 | return {web::http::status_codes::BadRequest, toWebJSON("Missing the my_measures_dir in the post data")}; |
| 721 | } |
| 722 | } |
| 723 | |
| 724 | MeasureManagerServer::ResponseType MeasureManagerServer::download_bcl_measure(const web::json::value& body) { // NOLINT |
| 725 | if (auto uid_ = get_field<std::string>(body, "uid")) { |