Get entry in moderation Draft

Hi everyone,
I’m trying to create a filter for moderation equal to Draft.
It doesn’t seem to work in any way, it always recovers the entry with published = published (perhaps from the first revision).

    $project = cockpit('collections')->find('projects_custom_preview', [
      'filter' => [
        'previewId' => $_GET['previewId'],
        'permalink' => $_GET['permalink'],
        'published' => 'Draft',

I added an entry in the collection:
previewId = 123
permalink = test
title = title test
Except in public mode, I later change the title to test 2 title.
In the database it is correct with draft mode and title test 2 title but the above query always shows me the data with title equal to test title.

I need help @raffaelj @pauloamgomes

Sorry, but I never used the Moderation addon. I always use the published field as a boolean value, so it doesn’t fit into my workflow.

Hi @alessandro92, please fill an issue on the addon repo to investigate further.
However looking to your example, not sure if that fits in the purpose of the moderation, since it should retrieve only published entries, to get drafts you need a previewToken param (at least when using rest api)