diff --git a/service/src/main/inse/projects/projects_search_client.py b/service/src/main/inse/projects/projects_search_client.py index a53c2f1f..0a0653b2 100644 --- a/service/src/main/inse/projects/projects_search_client.py +++ b/service/src/main/inse/projects/projects_search_client.py @@ -3,7 +3,7 @@ import logging from typing import Any, Dict, List, Optional, Set, Tuple import httpx - +import urllib from inse.config import get_settings from inse.models.bund_project import BundProject from inse.projects.model import ( @@ -193,7 +193,7 @@ def _complete_response_to_bund_project_page( def get_bund_project_by_id(project_id: str) -> Optional[BundProjectDetails]: - """Fetches the details of a single Bund project based on its project ID. + """Decodes project_id and fetches the details of a single Bund project based on its project ID. Args: project_id (str): The ID of the project to fetch. @@ -201,7 +201,9 @@ def get_bund_project_by_id(project_id: str) -> Optional[BundProjectDetails]: Returns: Optional[BundProjectDetails]: The details of the project if found, otherwise None. """ - query = {"term": {"Förderkennzeichen.keyword": {"value": project_id}}} + + decoded_id = urllib.parse.unquote(project_id) + query = {"term": {"Förderkennzeichen.keyword": {"value": decoded_id}}} response = elasticsearch.search( index=ESIndex.PROJECTS_BUND_V1, diff --git a/webapp/src/app/modules/projects/projects.component.ts b/webapp/src/app/modules/projects/projects.component.ts index 4fc6f46d..78563c74 100644 --- a/webapp/src/app/modules/projects/projects.component.ts +++ b/webapp/src/app/modules/projects/projects.component.ts @@ -118,7 +118,8 @@ export class ProjectsComponent { getDetaiLink(fundingProject: FundingProject): string | null { if (fundingProject.type === 'bund') { - return '/projects/bund/' + fundingProject.id; + const encodedId = encodeURIComponent(fundingProject.id) + return '/projects/bund/' + encodedId; } else if (fundingProject.type === 'dfg') { return '/projects/dfg/' + fundingProject.id; } else {