filtre ressources par étape + triées par ordre chrono
This commit is contained in:
@@ -120,6 +120,8 @@ export async function getRessourceItemCard(item) {
|
||||
vignette = null;
|
||||
}
|
||||
}
|
||||
|
||||
const relatedEtape = await REST.get(item.relationships.field_etape.links.related.href);
|
||||
|
||||
return {
|
||||
ressourceType: item.attributes.field_type_de_ressource,
|
||||
@@ -127,6 +129,7 @@ export async function getRessourceItemCard(item) {
|
||||
auteurice: item.attributes.field_autheurice,
|
||||
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,
|
||||
vignette
|
||||
};
|
||||
} catch (error) {
|
||||
|
@@ -55,6 +55,8 @@ export async function getGouvernance(rawContent) {
|
||||
}
|
||||
|
||||
export async function getRessources(rawContent) {
|
||||
console.log(rawContent);
|
||||
|
||||
const ressourcesPromises = rawContent.map(item => getRessourceItemCard(item));
|
||||
|
||||
return await Promise.all(ressourcesPromises);
|
||||
|
Reference in New Issue
Block a user