From ac46026f99454d80d8b7b27693d00f0c36a886f0 Mon Sep 17 00:00:00 2001 From: Erb3 <49862976+Erb3@users.noreply.github.com> Date: Mon, 11 Nov 2024 06:14:55 +0100 Subject: [PATCH] fix(frontend): mod search page with trailing slash (#2914) Replaces the substring operation to find project type with a regex. The regex is a bit complex, so I added a comment explaining it. Resolves #1382 --- apps/frontend/src/pages/search/[searchProjectType].vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/frontend/src/pages/search/[searchProjectType].vue b/apps/frontend/src/pages/search/[searchProjectType].vue index 9dd193b2f..aaac004e3 100644 --- a/apps/frontend/src/pages/search/[searchProjectType].vue +++ b/apps/frontend/src/pages/search/[searchProjectType].vue @@ -473,7 +473,7 @@ async function serverInstall(project) { } projectType.value = tags.value.projectTypes.find( - (x) => x.id === route.path.substring(1, route.path.length - 1), + (x) => x.id === route.path.replaceAll(/^\/|s\/?$/g, ""), // Removes prefix `/` and suffixes `s` and `s/` ); const noLoad = ref(false);