fix: valider data.user/data.artistes avant déréférencement

This commit is contained in:
2026-07-04 11:38:02 +04:00
parent c4f45f712a
commit 6f77c17003
6 changed files with 64 additions and 0 deletions
@@ -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}
})