diff --git a/src/reducers/schema/sourceSchema.js b/src/reducers/schema/sourceSchema.js index 3dc17dd..5f12be9 100644 --- a/src/reducers/schema/sourceSchema.js +++ b/src/reducers/schema/sourceSchema.js @@ -7,7 +7,7 @@ const sourceSchema = Joi.object().keys({ affil_1: Joi.string().allow(''), affil_2: Joi.string().allow(''), url: Joi.string().allow(''), - title: Joi.string().allow(''), + desc: Joi.string().allow(''), parent: Joi.string().allow(''), author: Joi.string().allow(''), date: Joi.string().allow(''), diff --git a/src/selectors/index.js b/src/selectors/index.js index e9535a5..0ef170d 100644 --- a/src/selectors/index.js +++ b/src/selectors/index.js @@ -170,8 +170,12 @@ export const selectSelected = createSelector( // NB: return source object if exists, otherwise null const srcs = selected .map(e => e.sources) - .map(_sources => - _sources.map(id => (sources.hasOwnProperty(id) ? sources[id] : null)) + .map(_sources => { + if (!_sources) return []; + return _sources.map(id => ( + sources.hasOwnProperty(id) ? sources[id] : null + )) + } ) return selected.map((s, idx) => ({