data = {
var result = []
artworks.forEach(artwork => {
result.push({
id: artwork.id,
title: artwork.title.en != null? artwork.title.en : artwork.title.fr,
url: artwork.url ? artwork.url.en : null,
year: artwork.produced_at,
artist: artwork.artists,
gender: genderTranslation(artwork.genreSimplifie),
categories: artwork.categories? artwork.categories.en : null,
territory: artwork.territory,
geolocation: artwork.location
})
})
return result
}