Skip to content

Commit 4fdd953

Browse files
authored
minor: fallback on the project id if the namespace is missing (#3353)
1 parent d9d5570 commit 4fdd953

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

client/src/features/searchV2/components/SearchV2Results.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ interface SearchV2ResultProjectProps {
263263
project: Project;
264264
}
265265
function SearchV2ResultProject({ project }: SearchV2ResultProjectProps) {
266-
const { creationDate, description, name, namespace, slug, visibility } =
266+
const { creationDate, description, id, name, namespace, slug, visibility } =
267267
project;
268268

269269
const namespaceUrl =
@@ -274,10 +274,15 @@ function SearchV2ResultProject({ project }: SearchV2ResultProjectProps) {
274274
: generatePath(ABSOLUTE_ROUTES.v2.groups.show.root, {
275275
slug: namespace?.namespace ?? "",
276276
});
277-
const projectUrl = generatePath(ABSOLUTE_ROUTES.v2.projects.show.root, {
278-
namespace: namespace?.namespace ?? "",
279-
slug,
280-
});
277+
const projectUrl =
278+
namespace?.namespace != null
279+
? generatePath(ABSOLUTE_ROUTES.v2.projects.show.root, {
280+
namespace: namespace.namespace,
281+
slug,
282+
})
283+
: generatePath(ABSOLUTE_ROUTES.v2.projects.showById, {
284+
id,
285+
});
281286

282287
return (
283288
<SearchV2ResultsContainer>

0 commit comments

Comments
 (0)