diff --git a/src/api/parole/content-types/parole/lifecycles.js b/src/api/parole/content-types/parole/lifecycles.js index 12b61bc..d2937b7 100644 --- a/src/api/parole/content-types/parole/lifecycles.js +++ b/src/api/parole/content-types/parole/lifecycles.js @@ -135,11 +135,15 @@ module.exports = { }, beforeUpdate: async event => { - let {data} = event.params - validateParoles(data.titre, data.transcription) - + let {data} = event.params const {where} = event.params + const currentData = await strapi.db.query('api::parole.parole').findOne({ + where: {id: where.id} + }) + + validateParoles(currentData.titre, currentData.transcription) + if(!data.publishedAt) { if (data.tit && !data.forceSlug) { const artiste = await jwennAwtisEpiId(data.artistes)