fix: whitelister les champs autorisés sur create/update (mass assignment)
This commit is contained in:
@@ -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
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user