Commit bcac78b7 authored by Tristan Cavelier's avatar Tristan Cavelier

IODeferred affect good default value to the storage response

parent 639e5b94
...@@ -18,16 +18,19 @@ IODeferred.prototype.resolve = function (a, b) { ...@@ -18,16 +18,19 @@ IODeferred.prototype.resolve = function (a, b) {
if (this._method === 'post') { if (this._method === 'post') {
weak.status = constants.http_status.created; weak.status = constants.http_status.created;
weak.statusText = constants.http_status_text.created; weak.statusText = constants.http_status_text.created;
} else if (this._method === 'remove' || this._method === 'removeAttachment') {
weak.status = constants.http_status.no_content;
weak.statusText = constants.http_status_text.no_content;
} else { } else {
weak.status = constants.http_status.ok; weak.status = constants.http_status.ok;
weak.statusText = constants.http_status_text.ok; weak.statusText = constants.http_status_text.ok;
}
if (this._info._id) { if (this._info._id) {
weak.id = this._info._id; weak.id = this._info._id;
} }
if (/Attachment$/.test(this._method)) { if (/Attachment$/.test(this._method)) {
weak.attachment = this._info._attachment; weak.attachment = this._info._attachment;
} }
}
weak.method = this._method; weak.method = this._method;
if (typeof a === 'string' || (typeof a === 'number' && isFinite(a))) { if (typeof a === 'string' || (typeof a === 'number' && isFinite(a))) {
......
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