fix: valider data.user/data.artistes avant déréférencement
This commit is contained in:
@@ -12,6 +12,10 @@ module.exports = createCoreController('api::artiste.artiste', ({strapi}) => ({
|
||||
const {body} = ctx.request
|
||||
let {data} = body
|
||||
|
||||
if (!data?.user?.documentId) {
|
||||
return ctx.badRequest('Informations manquantes.')
|
||||
}
|
||||
|
||||
const user = await strapi.documents('plugin::users-permissions.user').findOne({
|
||||
documentId: body.data.user.documentId
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user