From 8898bbe48285c7f9f11760ef420cca43d683d5e0 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 28 Mar 2016 13:59:50 -0400 Subject: modify links field to specify text and uri --- app/node_modules/okdb/index.js | 2 +- app/node_modules/okschema/index.js | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'app/node_modules') diff --git a/app/node_modules/okdb/index.js b/app/node_modules/okdb/index.js index 4820c8c..ad8d9a7 100644 --- a/app/node_modules/okdb/index.js +++ b/app/node_modules/okdb/index.js @@ -97,7 +97,7 @@ FSDB.prototype.update = function(collection, id, data) { } var result = chain.assign(cloneDeep(data)).value(); - if (result ) { + if (result) { return resolve(cloneDeep(result)); } else { return resolve(null, new Error('Problem updating document')); diff --git a/app/node_modules/okschema/index.js b/app/node_modules/okschema/index.js index 330ad6b..82aa13f 100644 --- a/app/node_modules/okschema/index.js +++ b/app/node_modules/okschema/index.js @@ -63,8 +63,21 @@ var types = { assertValid: function(spec, value) {} }, 'tag-list': { - parent: 'string', - assertValid: function(spec, value) {} + parent: [{ + uri: { type: 'string' }, + text: { type: 'string' } + }], + assertValid: function(spec, value) { + var message; + var actual; + if (!value || !value.length) { + throw [{ + message: 'Not an array', + expected: JSON.stringify(this.parent), + actual: value + }]; + } + } }, 'date': { parent: 'string', -- cgit v1.2.3-70-g09d2