diff --git a/src/ApiManager.php b/src/ApiManager.php index 3804df2..f783a1b 100644 --- a/src/ApiManager.php +++ b/src/ApiManager.php @@ -130,7 +130,7 @@ public function update(string $langcode, array $data) : ApiResponse { throw new ConfigException('Missing "helfi_navigation.api" key setting.'); } - $endpoint = sprintf('%s/%s', static::GLOBAL_MENU_ENDPOINT, $this->environmentResolver->getActiveEnvironment()->getId()); + $endpoint = sprintf('%s/%s', static::GLOBAL_MENU_ENDPOINT, $this->environmentResolver->getActiveProject()->getName()); $url = $this->getUrl('api', $langcode, ['endpoint' => $endpoint]); return $this->client->makeRequest('POST', $url, [ diff --git a/src/Plugin/rest/resource/GlobalMobileMenu.php b/src/Plugin/rest/resource/GlobalMobileMenu.php index f20f32c..7760a68 100644 --- a/src/Plugin/rest/resource/GlobalMobileMenu.php +++ b/src/Plugin/rest/resource/GlobalMobileMenu.php @@ -107,8 +107,8 @@ public function get(): ResourceResponse { } $projectName = $this->environmentResolver - ->getActiveEnvironment() - ->getId(); + ->getActiveProject() + ->getName(); $site_name = $this->configFactory->get('system.site')->get('name'); // Create menu tree and add data to the local menu.