I am using the community edition of strapi, as by installing the npx create-strapi-app my-project --quickstart In this, i signup with admin account on localhost, but when we create Collection Types and add some data in that collection, like having Categories as Collection and we enter the name of the Category as Dinner or something else. I want to know the flow of the api where its stores in which folder it exists. I checked in the api folder there is only routes defined and nothing in the services and controllers. I checked for the documentation, but nothing find in that.
Like in a Scenario, I want if the collection created or updated by admin panel, it will be printed in the console. Basically I want to override the controller of admin panel.
The Admin panel is a bit more complex and it’s separated from the end-user ones, the generalized controllers and services are in the content-manager plugin:
I just override the controller function of strapi-plugin-content-manager in nodeModules by adding the content-manager/controllers/collection-types.js in extension folder.
In which i override the update function but i want to override the controller function for certain routes or collection types. Unless the default function will work.
Can you tell me how to do that?
I assume, though I’ve never tried, you just need to check the incoming model and execute logic if that model matches some list of allowed models else it falls back to the default.
I’d suggest starting by throwing some console.log()s in and see what comes in.
Like if you were trying to modify the logic of:
The model comes from ctx.params (given this will be the internal model name which should be something like application::model.model)
I tried this approach when it comes to populate the document in the collection it is giving me the error MissingErrorSchema. So i attached the schema of the collection from api/orders/models/orders.settings.json to get rid of this error. When i am using with node and mongoDB, it is working perfectly fine. Can you please, help me in this?