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 !