From 4440ea022ae8edbd6ce87c40aaf15316749119f6 Mon Sep 17 00:00:00 2001 From: Barry Brands Date: Fri, 19 Jul 2024 14:00:13 +0200 Subject: [PATCH 1/2] endpoint changed to /opencatalogi --- pwa/src/apiService/apiService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pwa/src/apiService/apiService.ts b/pwa/src/apiService/apiService.ts index fcf938052..f5b609fde 100644 --- a/pwa/src/apiService/apiService.ts +++ b/pwa/src/apiService/apiService.ts @@ -105,7 +105,7 @@ export default class APIService { const authorization = this.JWT ? { Authorization: "Bearer " + this.JWT } : {}; return axios.create({ - baseURL: "https://nextcloud.test.commonground.nu/index.php/apps/opencatalog/api", + baseURL: "https://nextcloud.test.commonground.nu/index.php/apps/opencatalogi/api", headers: { Accept: "application/json", "Content-Type": "application/json", From 1227f08c44c356d158e05e733bd78abad2543a0f Mon Sep 17 00:00:00 2001 From: Barry Brands Date: Fri, 19 Jul 2024 16:42:21 +0200 Subject: [PATCH 2/2] Prevent crash when facets not found --- .../VerticalFiltersPublicationsTemplate.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pwa/src/templates/templateParts/filters/verticalFiltersPublications/VerticalFiltersPublicationsTemplate.tsx b/pwa/src/templates/templateParts/filters/verticalFiltersPublications/VerticalFiltersPublicationsTemplate.tsx index 9b3e7b816..52aca7de3 100644 --- a/pwa/src/templates/templateParts/filters/verticalFiltersPublications/VerticalFiltersPublicationsTemplate.tsx +++ b/pwa/src/templates/templateParts/filters/verticalFiltersPublications/VerticalFiltersPublicationsTemplate.tsx @@ -149,18 +149,18 @@ export const VerticalFiltersPublicationsTemplate: React.FC ({ + const statusWithData = getFilterOptions.data.facets["data.status"]?.map((status: any) => ({ label: _.upperFirst(status._id ?? "unknown"), value: status._id, })); // Themes - const themesWithData = getFilterOptions.data.facets["data.themes"].map((theme: any) => ( + const themesWithData = getFilterOptions.data.facets["data.themes"]?.map((theme: any) => ( { label: _.upperFirst(theme._id ?? "unknown"), value: theme._id, })); // Types (attachments.type) - const typesWithData = getFilterOptions.data.facets["attachments.type"].map((type: any) => ( + const typesWithData = getFilterOptions.data.facets["attachments.type"]?.map((type: any) => ( { label: _.upperFirst(type._id ?? "unknown"), value: type._id,