From 397962370d1a61b9cf8fe897caa58c0addb13ac9 Mon Sep 17 00:00:00 2001 From: tuutti Date: Fri, 26 Apr 2024 08:02:18 +0300 Subject: [PATCH 1/2] Use active project so we can remove environment id --- src/ApiManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, [ From 3590204cb9edecbfdb7a7eb9e772aaad37268995 Mon Sep 17 00:00:00 2001 From: tuutti Date: Fri, 26 Apr 2024 08:05:55 +0300 Subject: [PATCH 2/2] Use active project so we can remove environment id --- src/Plugin/rest/resource/GlobalMobileMenu.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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.