ignore unpublished entries from unknown collections

This commit is contained in:
Shawn Erquhart 2018-03-03 22:30:10 -05:00
parent 38c7ef94cd
commit 2a3b2d19fe

View File

@ -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;
}, []),
}));
}