From 6ca87c9b7bca59e8114d3ce5c1051ab6a699a045 Mon Sep 17 00:00:00 2001 From: Katrine Wist Date: Mon, 28 Aug 2023 10:55:42 +0200 Subject: [PATCH] Update src/api/searchApi.ts Co-authored-by: Gunnar Velle --- src/api/searchApi.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/searchApi.ts b/src/api/searchApi.ts index ce6f247f..f89f5c89 100644 --- a/src/api/searchApi.ts +++ b/src/api/searchApi.ts @@ -85,7 +85,7 @@ export async function groupSearch( resources: result.results.map(contentTypeResult => { const path = contentTypeResult.contexts.find(c => - subjects.length === 1 ? c.subjectId === subjects[0] : c.isPrimary, + subjects.length === 1 ? c.rootId === subjects[0] : c.isPrimary, )?.path ?? contentTypeResult.paths?.[0]; const isLearningpath =