Skip to content

Commit

Permalink
feat: support lang param for fau/v1/degree-program/index endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
shvlv committed Sep 4, 2024
1 parent 7c48978 commit fb48bb0
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ public function register_routes(): void
'methods' => WP_REST_Server::READABLE,
'callback' => [$this, 'getIndex'],
'permission_callback' => [$this, 'get_items_permissions_check'],
'args' => [
'lang' => self::languageParam(),
],
],
]);
register_rest_route($this->namespace, '/' . $this->rest_base . '/(?P<id>[\d]+)', [
Expand Down Expand Up @@ -190,7 +193,7 @@ public function getIndex(WP_REST_Request $request): WP_Error|WP_REST_Response

$views = $this->degreeProgramCollectionRepository->findTranslatedCollection(
$criteria,
MultilingualString::DE
$this->requestedLanguage($request)
);

if (!$views instanceof PaginationAwareCollection) {
Expand Down

0 comments on commit fb48bb0

Please sign in to comment.