diff --git a/src/components/dac_dataset_table/DACDatasetTableCellData.js b/src/components/dac_dataset_table/DACDatasetTableCellData.js
index 9ee1789a9..101b2d392 100644
--- a/src/components/dac_dataset_table/DACDatasetTableCellData.js
+++ b/src/components/dac_dataset_table/DACDatasetTableCellData.js
@@ -59,8 +59,8 @@ export function dataCustodianCellData({dataset, label = 'dataCustodianCellData'}
}
export function dataUseCellData({dataset, label = 'dataUseCellData'}) {
- const translationList = map((translation) => {
- return
{translation.code}: {translation.description};
+ const translationList = map((translation, index) => {
+ return {translation.code}: {translation.description};
})(dataset.translations);
const display =
diff --git a/src/libs/ajax.js b/src/libs/ajax.js
index e76c79992..69b492a97 100644
--- a/src/libs/ajax.js
+++ b/src/libs/ajax.js
@@ -205,8 +205,14 @@ export const DAR = {
},
searchOntologyIdList: async ids => {
+ if (isNil(ids) || ids.length === 0) {
+ return [];
+ }
const url = `${await getOntologyUrl()}/search?id=${ids}`;
- const res = await fetchOk(url, Config.authOpts());
+ const res = await fetchAny(url, Config.authOpts());
+ if (res.status >= 400) {
+ return [];
+ }
return await res.json();
},
diff --git a/src/libs/ontologyService.js b/src/libs/ontologyService.js
index 5a0b84755..956914336 100644
--- a/src/libs/ontologyService.js
+++ b/src/libs/ontologyService.js
@@ -1,10 +1,14 @@
import axios from 'axios';
-import { Notifications } from '../libs/utils';
+import { Notifications } from './utils';
import { getOntologyUrl } from './ajax';
+import isNil from 'lodash';
export const OntologyService = {
searchOntology: async (obolibraryURL) => {
+ if (isNil(obolibraryURL) || obolibraryURL.length === 0) {
+ return [];
+ }
const baseURL = await getOntologyUrl();
const params = {id: obolibraryURL};
try{