chore(calm-hub-ui): migrate from fetch to axios#2137
chore(calm-hub-ui): migrate from fetch to axios#2137selwyntheo wants to merge 1 commit intofinos:mainfrom
Conversation
|
|
Replace native fetch calls with axios in calm-service and authService for better testability via dependency injection. Convert calm-service from standalone functions to a CalmService class following the existing AdrService pattern, and add comprehensive tests for both services.
a23c7a3 to
71323fd
Compare
|
@selwyntheo thanks for the contribution! We'll take a look over this soon as we have some other PRs pending or coming up for calm-hub-ui. FYI @aamanrebello |
|
@markscott-ms - Thanks much!. Let me know how I can help on other issues. |
|
@selwyntheo if able, come along to an Office Hours meeting, every Thursday 1530 UK / 1030 EST. See https://github.com/finos/architecture-as-code?tab=readme-ov-file#getting-involved for details and #2136 for this week's - where we intend to agree what's next from #2075 as a focus area. If unable, you can always drop a comment on an office hours issue letting us know that you might pick up any issue from the backlog. It's definitely worth commenting before picking up anything just in case someone else is working on it or about to introduce a conflicting change. We will usually get back to any comments promptly. |
|
Thanks @markscott-ms . Will definitely try to attend office hours. Appreciate it |
Summary
calm-service.tsxfrom standalonefetch-based functions to aCalmServiceclass with injectableAxiosInstance, following the existingAdrServicepatternfetchcall inauthService.tsx(checkAuthorityService) withaxios.head()TreeNavigation.tsxand its tests to consume the new class-based APICalmService(20 tests) andcheckAuthorityService(2 tests)Closes #979
Test plan
npm testincalm-hub-ui/)npm run buildincalm-hub-ui/)fetch(calls incalm-hub-ui/src/service/orcalm-hub-ui/src/authService.tsx