Commit a84f4578 authored by Tristan Cavelier's avatar Tristan Cavelier

gidstorage.js wrong response returned - fixed

parent f3294a72
...@@ -330,7 +330,7 @@ ...@@ -330,7 +330,7 @@
if (method === 'post') { if (method === 'post') {
return command.error( return command.error(
"conflict", "conflict",
"Document already exist", "Document already exists",
"Cannot " + method + " document" "Cannot " + method + " document"
); );
} }
...@@ -388,7 +388,7 @@ ...@@ -388,7 +388,7 @@
if (response.total_rows === 0) { if (response.total_rows === 0) {
return command.error( return command.error(
"not_found", "not_found",
"Document already exist", "Document already exists",
"Cannot " + method + " attachment" "Cannot " + method + " attachment"
); );
} }
...@@ -397,9 +397,7 @@ ...@@ -397,9 +397,7 @@
command.storage(priv.sub_storage)[method + "Attachment"]( command.storage(priv.sub_storage)[method + "Attachment"](
doc doc
).then(function (response) { ).then(function (response) {
if (method !== 'get') { response.id = gid_object;
response.id = gid_object;
}
command.success(response); command.success(response);
}, function (err) { }, function (err) {
err.message = "Cannot " + method + " attachment"; err.message = "Cannot " + method + " attachment";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment