Hello @sunnyson
I’m building an e-commerce website for a client.
She would like to be able to create or update orders she receives, and I would like to create orders from the website.
But there are conditions about these orders, like the connection to Stripe for example, the calculous of the amount (which I put in the model already)…
So that’s it, I want to call a controller from my API (it’s already the case, it gets called) AND from Strapi’s admin dashboard (my client, and it’s easier to test for me also, but controller isn’t called)
// api/order/controllers/order.js
// This gets called from my API, but not from admin's dashboard, while model gets called for both
module.exports = {
create: async ctx => {
console.log('Creating...');
const order = await strapi.services.order.create(ctx.request.body);
return sanitizeEntity(order, { model: strapi.models.order });
},
};