Closed pablofernandezgh closed 4 years ago
Before Craft 3.2, drafts were only available in the one site that they were created in.
In Craft 3.2+, EntryResource
is actually no longer needed. So you can drop your class
and draftId
settings, and move $draftId
to the criteria
:
return [
'elementType' => craft\elements\Entry::class,
'criteria' => [
'drafts' => true,
'draftId' => $draftId;
'section' => 'homepageAds',
'site' => $site,
],
'paginate' => false,
'transformer' => new HomepageAdsTransformer($version)
];
Just released Element API 2.6.0 which deprecates EntryResource
and removes the section in the README about it.
When requesting a draft, I only see it in the primary language of my website. According to the docs, when setting a
draftId
thecriteria
gets ignored. Then how am I supposed to get this draft in a different locale ?Here's my query