Skip to content

Commit ee7cf82

Browse files
authored
Merge pull request #34 from FAIRDataPipeline/dev
fix file_extension
2 parents 5b8f49e + a9e1d97 commit ee7cf82

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ENDIF()
2424

2525
# Define Project
2626
PROJECT( fdpapi
27-
VERSION 0.2.5
27+
VERSION 0.2.6
2828
DESCRIPTION "C++ API for the FAIR Data Pipeline"
2929
HOMEPAGE_URL "https://github.com/FAIRDataPipeline/cppDataPipeline"
3030
LANGUAGES CXX C

src/registry/api.cxx

+3-3
Original file line numberDiff line numberDiff line change
@@ -218,13 +218,13 @@ Json::Value API::post_storage_root(Json::Value &post_data, const std::string &to
218218
}
219219

220220
Json::Value API::post_file_type(Json::Value &post_data, const std::string &token){
221-
if (!post_data["name"]){
221+
if (!post_data["extension"]){
222222
logger::get_logger()->error() << "Error: Post Data does not contain a file extension";
223223
throw rest_apiquery_error("Failed to post file_type");
224224
}
225-
post_data["name"] = boost::regex_replace(post_data["name"].asString(), boost::regex("."), "");
225+
post_data["extension"] = boost::regex_replace(post_data["extension"].asString(), boost::regex("."), "");
226226
Json::Value _file_type_query;
227-
_file_type_query["name"] = post_data["name"];
227+
_file_type_query["extension"] = post_data["extension"];
228228
Json::Value _file_type_exists = get_by_json_query("file_type", _file_type_query);
229229
if (_file_type_exists) {
230230
return _file_type_exists[0];

0 commit comments

Comments
 (0)