feat: Resynchronisation automatique des associations
This commit is contained in:
parent
a33dfc9322
commit
dc26afe2cb
|
@ -52,57 +52,57 @@ const config = {
|
|||
},
|
||||
deleteFields: [],
|
||||
},
|
||||
// Association: {
|
||||
// readByQueryOption: {
|
||||
// fields: [
|
||||
// 'denomination',
|
||||
// 'title',
|
||||
// 'description',
|
||||
// 'mail',
|
||||
// 'telephone',
|
||||
// 'site',
|
||||
// 'facebook',
|
||||
// 'bureau.sort',
|
||||
// 'bureau.Contact_id.*',
|
||||
// 'content',
|
||||
// ],
|
||||
// filterAssociation
|
||||
// },
|
||||
// pathBuilder: (association) => {
|
||||
// if (!association.title) {
|
||||
// association.title = association.denomination
|
||||
// }
|
||||
// console.log("Import de l'association « " + association.title + " »")
|
||||
// if (association.bureau && association.bureau.length > 0) {
|
||||
// const bureau = []
|
||||
// for (const contact of association.bureau) {
|
||||
// const detail = contact.Contact_id
|
||||
// if (detail) {
|
||||
// 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)
|
||||
// } else {
|
||||
// console.log("problème sur un contact")
|
||||
// }
|
||||
// }
|
||||
// association.bureau = bureau
|
||||
// } else {
|
||||
// delete association.bureau
|
||||
// }
|
||||
Association: {
|
||||
readByQueryOption: {
|
||||
fields: [
|
||||
'denomination',
|
||||
'title',
|
||||
'description',
|
||||
'mail',
|
||||
'telephone',
|
||||
'site',
|
||||
'facebook',
|
||||
'bureau.sort',
|
||||
'bureau.Contact_id.*',
|
||||
'content',
|
||||
],
|
||||
filterAssociation
|
||||
},
|
||||
pathBuilder: (association) => {
|
||||
if (!association.title) {
|
||||
association.title = association.denomination
|
||||
}
|
||||
console.log("Import de l'association « " + association.title + " »")
|
||||
if (association.bureau && association.bureau.length > 0) {
|
||||
const bureau = []
|
||||
for (const contact of association.bureau) {
|
||||
const detail = contact.Contact_id
|
||||
if (detail) {
|
||||
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)
|
||||
} else {
|
||||
console.log("problème sur un contact")
|
||||
}
|
||||
}
|
||||
association.bureau = bureau
|
||||
} else {
|
||||
delete association.bureau
|
||||
}
|
||||
|
||||
// return `./content/associations/${urlslug(association.denomination)}`;
|
||||
// },
|
||||
// deleteFields: [],
|
||||
// },
|
||||
return `./content/associations/${urlslug(association.denomination)}`;
|
||||
},
|
||||
deleteFields: [],
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue