Changes from codemod

This commit is contained in:
2026-04-21 21:35:59 +04:00
parent e7bc8790b1
commit b532981404
8 changed files with 689 additions and 569 deletions
@@ -1,10 +1,5 @@
'use strict';
/**
* Read the documentation (https://strapi.io/documentation/v3.x/concepts/models.html#lifecycle-hooks)
* to customize this model
*/
const { ApplicationError } = require("@strapi/utils").errors
const slugify = require('slugify')
+4 -2
View File
@@ -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
}