0

I can eager load in element-api the site name in the criteria passed, but i cant find a way of getting the language locale id into the criteria. This works

return [
'resourceKey' => 'shipStructureLevelOne',
                 'elementType' => Entry::class,
                 'criteria'    => ['section'   => 'ship', 
'site' => 'french-site',  'level' => 1],

but this

return [
'resourceKey' => 'shipStructureLevelOne',
                 'elementType' => Entry::class,
                 'criteria'    => ['section'   => 'ship', 
'locale' => 'fr',  'level' => 1],

returns

{
"error": {
    "code": 404,
    "message": "Invalid site handle: fr"
}

This seems the wrong error message or confusion between site handle and site language (i think site id is language - control panel has it labelled in backend as language.) But either way i cant find a way of loading the locale into the criteria - sit ehandle works fine but its technically wrong and not what I am trying to do

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.