1
0
Fork 0

fixed jslint warnings

This commit is contained in:
a-brandt 2013-06-18 16:50:50 +02:00
parent 71c5f89010
commit a9184ce73c
1 changed files with 5 additions and 8 deletions

View File

@ -908,10 +908,7 @@ function parseDocumentByStructure(req, res, structure, body, isPatch) {
if (structure.attributes.hasOwnProperty(key)) {
value = body[key];
if (isPatch && undefined === value) {
// ignore
}
else {
if (!isPatch || undefined !== value) {
if (format) {
value = parseValue(value, structure.attributes[key], types, lang);
}
@ -928,13 +925,13 @@ function parseDocumentByStructure(req, res, structure, body, isPatch) {
}
if (undefined !== body._id) {
document['_id'] = body._id;
document._id = body._id;
}
if (undefined !== body._rev) {
document['_rev'] = body._rev;
document._rev = body._rev;
}
if (undefined !== body._key) {
document['_key'] = body._key;
document._key = body._key;
}
return document;
@ -1662,7 +1659,7 @@ function post_api_structure (req, res) {
structure = db._collection("_structures").document(collection.name());
saveDocumentByStructure(req, res, collection, structure, body);
}
catch (err) {
catch (err3) {
saveDocument(req, res, collection, body);
}
}