fix: whitelister les champs autorisés sur create/update (mass assignment)

This commit is contained in:
2026-07-04 15:08:19 +04:00
parent 1d54d287e1
commit 90c048a282
6 changed files with 108 additions and 8 deletions
+11 -2
View File
@@ -61,7 +61,11 @@ module.exports = createCoreController('api::parole.parole', ({strapi}) => ({
documentId: data.documentId,
data: {
...data
titre: data.titre,
transcription: data.transcription,
traductions: data.traductions,
traductionAuto: data.traductionAuto,
artistes: data.artistes
}
})
@@ -119,7 +123,12 @@ module.exports = createCoreController('api::parole.parole', ({strapi}) => ({
const newParole = await strapi.documents('api::parole.parole').create({
data: {
...data
titre: data.titre,
transcription: data.transcription,
traductions: data.traductions,
traductionAuto: data.traductionAuto,
artistes: [artiste.id],
user: user.id
}
})