Add a service for fetching the API route directory and page links.
Fetching the API route directory is currently the responsibility of the API client ("store") service. The "store" service makes authenticated API calls and therefore depends on the "auth" service. This means that we cannot use the API route directory or the page links returned from `/api/links` in the auth service itself, as this would introduce a circular dependency. Factoring out the responsibility for fetching the `/api` and `/api/links` endpoints into a separate service which does not use authentication provides a way to resolve this problem. It also makes testing some aspects of handling these endpoints, such as caching and auto-retry if the HTTP request fails, a little easier.
Showing
src/sidebar/api-routes.js
0 → 100644
Please register or sign in to comment