Skip to content

use global apiservice in plannings request#606

Merged
cafca merged 5 commits intodevelopfrom
refactor/use_global_apiservice_in_plannings_request
Oct 28, 2020
Merged

use global apiservice in plannings request#606
cafca merged 5 commits intodevelopfrom
refactor/use_global_apiservice_in_plannings_request

Conversation

@s-pic
Copy link
Copy Markdown
Collaborator

@s-pic s-pic commented Oct 23, 2020

What change does this add?

We start to use the centralized api client added in #370 by replacing the direct invocation of ky with the new servide.
Tests make sure the swap did not break anything.

Fixes #542
Fixes #541

How Has This Been Tested?

Run added unit tests

What workload does it derive?

What else is there to notice?

  • IMHO the TS types used in MapState.ts need some more love. For example we type MapState.planning as boolean, instead it contains an object containing the raw (?) api response

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 23, 2020

Codecov Report

Merging #606 into develop will increase coverage by 0.13%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #606      +/-   ##
===========================================
+ Coverage    25.85%   25.99%   +0.13%     
===========================================
  Files          374      374              
  Lines         7607     7609       +2     
  Branches      1899     1908       +9     
===========================================
+ Hits          1967     1978      +11     
+ Misses        5250     5241       -9     
  Partials       390      390              
Flag Coverage Δ
#unittests 25.99% <100.00%> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/services/api/shorthands.ts 100.00% <ø> (ø)
src/apps/Map/MapState.ts 47.05% <100.00%> (+6.05%) ⬆️
src/services/api/index.ts 100.00% <0.00%> (+100.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3423b90...eb55f60. Read the comment docs.

Comment thread src/apps/Map/MapState.ts Outdated
Comment thread src/apps/Map/MapState.unit.test.ts Outdated
Copy link
Copy Markdown
Collaborator

@cafca cafca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect!

@cafca cafca merged commit 07b141e into develop Oct 28, 2020
@cafca cafca deleted the refactor/use_global_apiservice_in_plannings_request branch October 28, 2020 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor plannings map to handle API requests through global API service Add tests for API requests in the planning map

2 participants