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
This commit is contained in:
Erb3 2024-11-11 06:14:55 +01:00 committed by GitHub
parent 3ef56ce66e
commit ac46026f99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);