Hey, I have a custom API route that queries some content like this:
payload.find({
collection: 'video-content',
where: { and: [{ topics: { in: [topicId] } }, ...preferenceFilter] },
sort: '-publishedAt',
limit: videoContentCount,
page,
select: videoContentDefaultPopulateOrSelect,
req,
}),
While manually testing, I noticed it returns a document marked UNPUBLISHED. I have an access rule for that video-content collection that filters non-published content:
if (user.collection === 'app-users') {
return { _status: { equals: 'published' } }
}
if the content has never been published before, it works as expected. But then, if I publish the document and then unpublish it, I get results.
I also tried using draft: true and I get the same data.
Does anyone know if this is a known issue or am I missing anything?