Sequelize validations not launched when route is overriden

Hi there,

On my forest admin back office, I’m using custom routes to update and create a product as explained in the documentation. It always worked perfect and my custom validations set up on forest admin were also working.

Since 2 days, these validations are not launched at all. Seems that I’ve to use the next() function to make it work but I don’t want to because it’d break all the rest.

Here’s a snippet of my create products route =>

router.post('/products', permissionMiddlewareCreator.create(), (request, response, next) => {
  const recordCreator = new RecordCreator(products);
  const data = request.body.data.attributes
  const categoryId = request.body.data.relationships.category.data.id;
  data['categoryId'] = categoryId
  axios({
    url: `${process.env.BASE_URL}/create-products`,
    method: 'post',
    data: data,
  })
    .then(async (result) => {
      response.send(await recordCreator.serialize(result.data));
    })
    .catch((error) => {
      console.log('error:', error);
    });
});

Could you help ?

Thanks a lot !

Hi @yonitou :wave: welcome to our community.
What kind of validation do you talk about?

Can you give me the name of your project and the version of forest-express-sequelize?

Hi !

I’m talking about Sequelize validations, here are some snippets :

The name of my project is go-movido-admin
forest-express-sequelize version is 6.7.1

What is the code of this endpoint?

Have you proceed on an update of the forest-express-sequelize package?