strata / frontend

The front of Headless CMS. Build an efficient front-end website taking content from multiple data sources.
MIT License
13 stars 5 forks source link

Querying an API with additional fields that aren't coming through to the frontend app #53

Open sean-dunwoody opened 5 years ago

sean-dunwoody commented 5 years ago

I'm querying an API endpoint, which has the following base fields:

The last field isn't coming through to the controller I'm using.

I've tracked this down to the following class:

Studio24\Frontend\Api\Providers\RestApi

Specifically, the lines below (in the list method):

$response = new ListResponse($data['results'], $pages);
$response->setMetaData($data['meta']);
return $response;

(this is being called from within the Studio24\Frontend\Cms\RestData class)

As you can see, the results and meta values are being passed through, but nothing else.

This would be a problem whenever an additional field (that isn't nested within meta or results) needs to be accessed from an API endpoint.