NC-COVID-Support icon indicating copy to clipboard operation
NC-COVID-Support copied to clipboard

Pull the resources map data from the API

Open MiguelLopez6 opened this issue 4 years ago • 3 comments

Description of the new functionality Get the resources data from the API available at https://nccovid.vizioz.com/ to populate the data shown in the map.

What we need to code Create a REST API call to get the categories from https://nccovid.vizioz.com/api/v1/resource/getbycategory/{categoryId}

HTTP GET https://nccovid.vizioz.com/api/v1/resource/getbycategory/{categoryId}

Where {categoryId} is the id of the category we want to display data for. Use the data returned to populate the map resources.

The data returned is in JSON format, containing a list of all resources available.

Additional context

The documentation for the API can be found at https://github.com/Vizioz/CovidSupport/blob/master/documentation.md

MiguelLopez6 avatar Jul 18 '20 21:07 MiguelLopez6

One thing to keep in mind when working on this ticket is that currently the entire dataset is being downloaded when the page first loads, when we implement this change, this will need to be re-coded so that the API is called each time the user selects a different category.

It would of course be good to cache these calls on the client, I think we will add this in a future iterative change.

readingdancer avatar Jul 18 '20 22:07 readingdancer

This issue is linked to: https://github.com/code-for-chapel-hill/NC-COVID-Support/issues/262 which needs to be implemented first for you to get the right ID's to request the data :)

readingdancer avatar Jul 23 '20 01:07 readingdancer

Please add the API URL to the /themes/theme.config.js file so that it is configurable per site.

readingdancer avatar Jul 23 '20 01:07 readingdancer