Skip to content

Commit

Permalink
Merge pull request #275 from biglotteryfund/remove-old-flexible-conte…
Browse files Browse the repository at this point in the history
…nt-endpoint

Actually remove the endpoint
  • Loading branch information
mattandrews authored May 28, 2020
2 parents a669f50 + 37bb4c5 commit 065f2ad
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions config/element-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -597,35 +597,6 @@ function getListing($locale)
];
}

/**
* API Endpoint: Get flexible content
* Get a page using the flexible content field model
*/
function getFlexibleContent($locale)
{
normaliseCacheHeaders();

$pagePath = \Craft::$app->request->getParam('path');

return [
'serializer' => 'jsonApi',
'elementType' => Entry::class,
'one' => true,
'criteria' => [
'site' => $locale,
'uri' => $pagePath,
// Limited to certain sections using flexible content
'section' => ['aboutLandingPage'],
],
'transformer' => function (Entry $entry) use ($locale) {
$common = ContentHelpers::getCommonFields($entry, $locale);
return array_merge($common, [
'flexibleContent' => ContentHelpers::extractFlexibleContent($entry, $locale),
]);
},
];
}

/**
* Get project stories
*/
Expand Down Expand Up @@ -881,7 +852,6 @@ function getMerchandise($locale)
'api/v1/<locale:en|cy>/hero-image/<slug>' => getHeroImage,
'api/v1/<locale:en|cy>/homepage' => getHomepage,
'api/v1/<locale:en|cy>/listing' => getListing,
'api/v1/<locale:en|cy>/flexible-content' => getFlexibleContent,
'api/v1/<locale:en|cy>/our-people' => getOurPeople,
'api/v1/<locale:en|cy>/data' => getDataPage,
'api/v1/<locale:en|cy>/aliases' => getAliases,
Expand Down

0 comments on commit 065f2ad

Please sign in to comment.