Bookshelf custom ID?

Hello,

I have a UUID field linked the “xxxxx_id” (like a title field - string/text field) and I have create the models beforeCreate to generate an new UUID when my new content is create by user via an endpoint API but I have an error 500 who said “duplicate id” when I have two contents to have the similar xxxxx_id.

We can’t geneate UUID by endpoint API content ? Thx

lifecycles: {
beforeCreate: async (data) => {
if (data.xxxxx_id) {
data.slug = slugify(data.xxxxx_id);
}
},

  • Mongoose database
  • Last v. Strapi (3.5.4)