feat: Modification des associations
This commit is contained in:
@ -14,7 +14,47 @@ const config = {
|
||||
const [year, month, day] = article.date.split("-")
|
||||
return `./content/actualites/${year}/${month}/${day}-${urlslug(article.title, { remove: /\./g })}`;
|
||||
}
|
||||
}
|
||||
},
|
||||
Association: {
|
||||
readByQueryOption: {
|
||||
fields: [
|
||||
'denomination',
|
||||
'title',
|
||||
'description',
|
||||
'mail',
|
||||
'telephone',
|
||||
'site',
|
||||
'facebook',
|
||||
'bureau.sort',
|
||||
'bureau.Contact_id.*',
|
||||
'content',
|
||||
]
|
||||
},
|
||||
pathBuilder: (association) => {
|
||||
if (!association.title) {
|
||||
association.title = association.denomination
|
||||
}
|
||||
const bureau = []
|
||||
for (const contact of association.bureau) {
|
||||
const detail = contact.Contact_id
|
||||
let c = {
|
||||
denomination: detail.denomination,
|
||||
prenom: detail.prenom,
|
||||
nom: detail.nom,
|
||||
}
|
||||
if (detail.mail && detail.display_mail) {
|
||||
c.mail = detail.mail
|
||||
}
|
||||
if (detail.telephone && detail.display_telephone) {
|
||||
c.telephone = detail.telephone
|
||||
}
|
||||
bureau.push(c)
|
||||
}
|
||||
association.bureau = bureau
|
||||
|
||||
return `./content/associations/${urlslug(association.denomination)}`;
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user