documentation icon indicating copy to clipboard operation
documentation copied to clipboard

[Request]: Adding mdw to >all< routes of one content type

Open nikita-fuchs opened this issue 2 years ago • 1 comments

Summary

In https://docs.strapi.io/dev-docs/backend-customization/routes, it's explained how to add middlewares to specific routes of one content type, e.g. find. But how does one make a middleware function run on all routes of one data type?

Why is it needed?

One sometimes needs a middleware function to run on all routes of one datatype.

Suggested solution(s)

Just add an explanation / example maybe.

Related issue(s)/PR(s)

No response

nikita-fuchs avatar Mar 11 '24 16:03 nikita-fuchs

This issue has been mentioned on Strapi Community Forum. There might be relevant details there:

https://forum.strapi.io/t/controller-functions-dont-reflect-on-ctx/36558/28

strapi-bot avatar Mar 11 '24 16:03 strapi-bot