fix: valider data.user/data.artistes avant déréférencement
This commit is contained in:
@@ -8,6 +8,10 @@ module.exports = createCoreController('api::commentaire.commentaire', ({strapi})
|
||||
const {body} = ctx.request
|
||||
let {data} = body
|
||||
|
||||
if (!data?.user?.id || !data?.parole) {
|
||||
throw new ApplicationError('Informations manquantes.')
|
||||
}
|
||||
|
||||
const user = await strapi.db.query('plugin::users-permissions.user').findOne({
|
||||
where: {id: data.user.id}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user