diff --git a/src/jio.storage/localstorage.js b/src/jio.storage/localstorage.js index 9d1f8ed60225a9f30bc22555fda0f5edb8813f31..5318cfb178e113d35f1e702913230fe1bb8a6983 100644 --- a/src/jio.storage/localstorage.js +++ b/src/jio.storage/localstorage.js @@ -215,7 +215,7 @@ * @param {Object} options The command options */ LocalStorage.prototype.putAttachment = function (command, param) { - var that = this, doc, status = "ok"; + var that = this, doc, status = "created"; doc = this._storage.getItem(this._localpath + "/" + param._id); if (doc === null) { // the document does not exist @@ -231,7 +231,7 @@ jIO.util.readBlobAsBinaryString(param._blob).then(function (e) { doc._attachments = doc._attachments || {}; if (doc._attachments[param._attachment]) { - status = "created"; + status = "no_content"; } doc._attachments[param._attachment] = { "content_type": param._blob.type, diff --git a/test/jio.storage/localstorage.tests.js b/test/jio.storage/localstorage.tests.js index 8adf2c510accb6bc77fff01c18beba7c8950454b..06e8c99702e84d5cb19d0e81d992efb4ee75f786 100644 --- a/test/jio.storage/localstorage.tests.js +++ b/test/jio.storage/localstorage.tests.js @@ -344,8 +344,8 @@ "id": "putattmt1", "method": "putAttachment", "result": "success", - "status": 200, - "statusText": "Ok" + "status": 201, + "statusText": "Created" }, "PutAttachment to a document, without data"); }).then(function () {