Commit 5779a7ff authored by Sven Franck's avatar Sven Franck

jslint pass putCommand.js

parent 5053f7cd
var putCommand = function(spec, my) { /*jslint indent: 2, maxlen: 80, sloppy: true */
/*global command: true */
var putCommand = function (spec, my) {
var that = command(spec, my); var that = command(spec, my);
spec = spec || {}; spec = spec || {};
my = my || {}; my = my || {};
// Attributes //
var priv = {};
// Methods // // Methods //
that.getLabel = function() { that.getLabel = function () {
return 'put'; return 'put';
}; };
that.validateState = function () { that.validateState = function () {
if (!(typeof that.getDocId() === "string" && that.getDocId() !== "")) { if (!(typeof that.getDocId() === "string" && that.getDocId() !==
"")) {
that.error({ that.error({
"status": 20, "status": 20,
"statusText": "Document Id Required", "statusText": "Document Id Required",
...@@ -21,12 +22,12 @@ var putCommand = function(spec, my) { ...@@ -21,12 +22,12 @@ var putCommand = function(spec, my) {
}); });
return false; return false;
} }
if (typeof that.getAttachmentId() !== "undefined") { if (that.getAttachmentId() !== undefined) {
that.error({ that.error({
"status": 21, "status": 21,
"statusText": "Invalid Document Id", "statusText": "Invalid Document Id",
"error": "invalid_document_id", "error": "invalid_document_id",
"message": "The document id contains '/' characters "+ "message": "The document id contains '/' characters " +
"which are forbidden", "which are forbidden",
"reason": "Document id contains '/' character(s)" "reason": "Document id contains '/' character(s)"
}); });
...@@ -34,10 +35,8 @@ var putCommand = function(spec, my) { ...@@ -34,10 +35,8 @@ var putCommand = function(spec, my) {
} }
return true; return true;
}; };
that.executeOn = function (storage) {
that.executeOn = function(storage) { storage.put(that);
storage.put (that);
}; };
return that; return that;
}; };
\ No newline at end of file
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