MODIF CONFIGS DRUPAL centre de ressources: tri par étape + ressources mis en avant
This commit is contained in:
@@ -67,7 +67,7 @@ export async function getRelatedEtape(direction, path) {
|
||||
});
|
||||
}
|
||||
|
||||
export async function getRessourceItemCard(item) {
|
||||
export async function getRessourceItemCard(item) {
|
||||
try {
|
||||
const ressourceFetch = await REST.get(item.links.self.href);
|
||||
|
||||
@@ -121,12 +121,15 @@ export async function getRessourceItemCard(item) {
|
||||
}
|
||||
}
|
||||
|
||||
const relatedEtape = await REST.get(item.relationships.field_etape.links.related.href);
|
||||
const relatedEtape = await REST.get(item.relationships.field_etape.links.related.href);
|
||||
console.log(item);
|
||||
|
||||
|
||||
return {
|
||||
ressourceType: item.attributes.field_type_de_ressource,
|
||||
title: item.attributes.title,
|
||||
auteurice: item.attributes.field_autheurice,
|
||||
promoted: item.attributes.field_mis_en_avant,
|
||||
date: getCleanDate(item.attributes.field_date_ressource),
|
||||
url: ressourceFetch.data.data.attributes.metatag.find(tag => tag.tag === "link")?.attributes.href,
|
||||
relatedEtape: relatedEtape.data.data.attributes.title,
|
||||
|
Reference in New Issue
Block a user