Skip to content

Commit

Permalink
ignore unpublished entries from unknown collections
Browse files Browse the repository at this point in the history
  • Loading branch information
erquhart committed Mar 4, 2018
1 parent 38c7ef9 commit 2a3b2d1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/backends/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,13 @@ class Backend {
))
.then(entries => ({
pagination: 0,
entries: entries.map(entry => {
entries: entries.reduce((acc, entry) => {
const collection = collections.get(entry.collection);
return this.entryWithFormat(collection)(entry);
}),
if (collection) {
acc.push(this.entryWithFormat(collection)(entry));
}
return acc;
}, []),
}));
}

Expand Down

0 comments on commit 2a3b2d1

Please sign in to comment.