0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Added type:post enforcement when fetching posts for collections

refs https://github.com/TryGhost/Team/issues/3148

- Collections should never ever operate on pages, so limiting them at the fetch stage is the bes possible place, so they don't enter the system when an automatic collection is created.
This commit is contained in:
Naz 2023-06-05 15:04:57 +07:00
parent 260ca0548a
commit 1968296410
No known key found for this signature in database

View file

@ -15,7 +15,8 @@ class CollectionsServiceWrapper {
postsRepository: {
getAll: async ({filter}) => {
return models.Post.findAll({
filter
// @NOTE: enforce "post" type to avoid ever fetching pages
filter: `(${filter})+type:post`
});
}
}