Changes from codemod
This commit is contained in:
@@ -26,7 +26,9 @@ module.exports = createCoreController('api::artiste.artiste', ({strapi}) => ({
|
||||
}
|
||||
}
|
||||
|
||||
const user = await strapi.entityService.findOne('plugin::users-permissions.user', body.data.user.id)
|
||||
const user = await strapi.documents('plugin::users-permissions.user').findOne({
|
||||
documentId: "__TODO__"
|
||||
})
|
||||
|
||||
if (!user) {
|
||||
throw new NotFoundError('Utilisateur introuvable.')
|
||||
@@ -43,7 +45,7 @@ module.exports = createCoreController('api::artiste.artiste', ({strapi}) => ({
|
||||
if (artiste) {
|
||||
return artiste
|
||||
} else {
|
||||
const newArtiste = await strapi.entityService.create('api::artiste.artiste', {
|
||||
const newArtiste = await strapi.documents('api::artiste.artiste').create({
|
||||
data: {
|
||||
...data
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user