At first thx @DMehaffy!
So if I understand how the admin panel is CSR React so we can’t call the REST controllers defined in the api folder (location strapi/api/whateverController/*.js). So expect the way I mention in the init question I can’t do more ‘better’ ?
I mean my purpose is to make something clean as you did for the admin panel editor (location extension folder where I custom my editor). So there is solutions that strapi already provide to call the REST controllers, instead of the https requests use to do when front talk with a server ? because I would like to shut all my api public routes.
I’m not sure if I’m enough clear… but step by step is the following:
- Create / Edit post on the admin panel ;
- Typing some text inside the post’s body (rich text) ;
- Press bellow the editor ‘Preview’ button (just display the HTML from the editor in a modal) ;
During the step 3, before render the HTML. I need to fetch from the BDD, posts mentioned. So I parse my HTML to find post’s ids and get then from bdd to have the most accurate preview.
It’s the moment where I need to access the REST api to get the data more efficiency (quickly, etc…) instead of making http request to do what I mentioned earlier and shut all my public route.