Skip to content

Instantly share code, notes, and snippets.

@jbothma
Last active July 7, 2023 11:09
Show Gist options
  • Save jbothma/4d218e83da0d1196ced73dd4858bf02d to your computer and use it in GitHub Desktop.
Save jbothma/4d218e83da0d1196ced73dd4858bf02d to your computer and use it in GitHub Desktop.

API data practice tasks

This task will give you practice

  • making sense of an unfamiliar API using its documentation
  • handling, transforming and combining data, and coming up with data structures that enable you to present it easily
  • dealing with interdependent API responses that complete in an arbitrary order, and ideally presenting progressively more information to the user as more data becomes available

Focus on logic and clean understandable code rather than visual design.

Task 1

Task 2

Set your git repository up to automatically deploy changes on vercel

Task 3

Show a loading state until the municipality data has loaded and municipalities can be shown.

Task 4

Group municipalities by province. Show a heading for each province name.

Task 5

  • Add each municipality's Audited Actual Cash Balance to the page for the 2020-2021 financial year beside its name.
  • The municipality's name should show so long once available, even if the cash balance data has not loaded yet.
  • If the Cash Balance data is available before municipalit names, wait for them to load before showing anything other than the main loading state.
  • Show a loading state in the cash balance value container to indicate to the user that the data is still loading.
  • Use the cash balance example at https://municipalmoney.gov.za/profiles/municipality-NC074-kareeberg/ to find the correct value to fetch from the API

Task 6

Use the demarcation_changes cube to identify disestablished municipalities and exclude them from the page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment