Diff only if paroles was published
This commit is contained in:
@@ -141,11 +141,11 @@ module.exports = {
|
|||||||
populate: {difference: true}
|
populate: {difference: true}
|
||||||
})
|
})
|
||||||
|
|
||||||
if (data.transcription) {
|
if (data.transcription && previousParoles.publishedAt) {
|
||||||
const difference = strapi.service('api::parole.parole').parolesDiff(data.titre, previousParoles.transcription, data.transcription)
|
const difference = strapi.service('api::parole.parole').parolesDiff(data.titre, previousParoles.transcription, data.transcription)
|
||||||
|
|
||||||
state.diff = difference
|
state.diff = difference
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!data.publishedAt && data.titre && data.transcription) {
|
if(!data.publishedAt && data.titre && data.transcription) {
|
||||||
strapi.service('api::parole.parole').validateParoles(data.titre, data.transcription)
|
strapi.service('api::parole.parole').validateParoles(data.titre, data.transcription)
|
||||||
|
|||||||
Reference in New Issue
Block a user