In the admin panel - I have a content-type products
, which shows me all the products in the database (MongoDB)
Suppose I would like to edit a product
and when I click on the Save
button, I would like to hit a custom API/ override the existing endpoint that updates my
products
collection!
Is it possible to customize or override the admin panel APIs?
You will find a file called logo-strapi. png (there will be another file with almost similar file name, make sure its a - and not _ ) and replace it with your desired logo. The approx dimens of the old logo as 1100px x 300px , so make sure your new logo also is of similar dimens.
The Strapi Design System is fully customizable and has a dedicated StoryBook documentation.
Strapi runs an HTTP server based on Koa , a back end JavaScript framework.
Update(v4): Judging by the comments - this answer is now outdated as things have changed for v4.
The Strapi admin(strapi-admin) and Content manager(strapi-plugin-content-manager) are defined separately.
If you'd like to override/extend the endpoints; do so by defining the functions you want to override like so:
Locate the controller at:
extensions/<plugin-name>/controllers/<controller-to-override-name>.js
Example:
extensions/content-manager/controllers/ContentManager.js
Notice that the "strapi-plugin" part of the name was dropped!
Example of how to override and extend in controller file:
'use strict';
module.exports = {
//this is how you destroy count
async count(ctx) {
ctx.body = {
count: 99
};
},
//this is how you extend
async aFuncThatDoesntExistInOriginalController(ctx) {
//add logic
},
};
If you're extending you must add a mapping from route to controller & method
To see which endpoint is mapped to which method in the controller check out:
node_modules/<plugin-name>/config/routes.json
node_modules/strapi-plugin-content-manager/config/routes.json
Some basic info in docs: controllers, customization1 & customization2 and FAQ
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With