chg: [organisations:index] Added support of `full` option to include metafields

develop-unstable
Sami Mokaddem 2022-12-02 09:51:28 +01:00
parent 813ec6f0a5
commit 89a13a12a0
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 6 additions and 1 deletions

View File

@ -65,6 +65,11 @@ class OrganisationsController extends AppController
]
];
}
$additionalContainFields = [];
if ($this->ParamHandler->isRest() && !empty($this->request->getQuery('full'))) {
$additionalContainFields[] = 'MetaFields';
}
$containFields = array_merge($this->containFields, $additionalContainFields);
$this->CRUD->index([
'filters' => $this->filterFields,
@ -73,7 +78,7 @@ class OrganisationsController extends AppController
'contextFilters' => [
'custom' => $customContextFilters,
],
'contain' => $this->containFields,
'contain' => $containFields,
'statisticsFields' => $this->statisticsFields,
]);
$responsePayload = $this->CRUD->getResponsePayload();