Skip to content

Commit 72bc6c7

Browse files
committed
NovelCOVID API: historical data changed to 30 days #437
1 parent a986d9c commit 72bc6c7

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

apps/covid/view/TableContainerController.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ class TableContainerController extends ComponentController {
1919
* @member {String} apiHistoricalDataEndpoint='historical'
2020
*/
2121
apiHistoricalDataEndpoint: 'v2/historical/',
22+
/**
23+
* Number of days you want the data to go back to. Default is 30. Use all for full data set. Ex: 15, all, 24
24+
* @member {Number|String} apiHistoricalDataTimeRange='all'
25+
*/
26+
apiHistoricalDataTimeRange: 'all',
2227
/**
2328
* @member {Object} selectedRecord=null
2429
*/
@@ -110,7 +115,7 @@ class TableContainerController extends ComponentController {
110115
*/
111116
loadHistoricalData(countryName) {
112117
const me = this,
113-
apiPath = me.apiBaseUrl + me.apiHistoricalDataEndpoint + countryName;
118+
apiPath = me.apiBaseUrl + me.apiHistoricalDataEndpoint + countryName + '?lastdays=' + me.apiHistoricalDataTimeRange;
114119

115120
fetch(apiPath)
116121
.then(response => response.json())

0 commit comments

Comments
 (0)