From f3b7f37ef42910a302bffee703de165d471158d4 Mon Sep 17 00:00:00 2001 From: Kevin Miller Date: Wed, 5 Aug 2020 09:18:44 -0700 Subject: [PATCH] chore: Change API domain name --- src/components/common/summary-charts.js | 5 +++-- src/components/pages/data/api/explorer.js | 8 +++++--- src/pages/data/api.js | 7 +++++++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/components/common/summary-charts.js b/src/components/common/summary-charts.js index 5390a472e..a7ae0ec45 100644 --- a/src/components/common/summary-charts.js +++ b/src/components/common/summary-charts.js @@ -201,8 +201,9 @@ export default ({ name = 'National', history, usHistory, annotations }) => { [usHistory, usePerCap, sliceStart, sliceEnd], ) - // TODO: These two state exemptions should be removed after they reach 30 days of - // hospitalization data. That or we should rethink this requirement. -goleary + // TODO: These two state exemptions should be removed after they + // reach 30 days of hospitalization data. That or we should + // rethink this requirement. -goleary const hasData = field => name === 'Hawaii' || name === 'Florida' || diff --git a/src/components/pages/data/api/explorer.js b/src/components/pages/data/api/explorer.js index 447d670df..d103b2c86 100644 --- a/src/components/pages/data/api/explorer.js +++ b/src/components/pages/data/api/explorer.js @@ -11,7 +11,7 @@ import explorerStyles from './explorer.module.scss' import definition from '../../../../../_api/v1/openapi.json' const PreviewUrl = ({ path, format, parameters }) => { - let examplePath = path.replace('{format}', format) + let examplePath = path.replace('{format}', format).replace('/api/', '/') parameters.forEach(parameter => { if (parameter.name !== 'format') { examplePath = examplePath.replace( @@ -23,12 +23,14 @@ const PreviewUrl = ({ path, format, parameters }) => { return ( <>

- {path.replace('{format}', format)} + {path.replace('{format}', format).replace('/api/', '/')}

Example:{' '} - {examplePath} + {`https://api.covidtracking.com${examplePath}`}

diff --git a/src/pages/data/api.js b/src/pages/data/api.js index ee3df852e..48b905f56 100644 --- a/src/pages/data/api.js +++ b/src/pages/data/api.js @@ -19,6 +19,13 @@ export default ({ data }) => { id={data.contentfulSnippet.contentful_id} /> +

API domain name

+

+ All API requests should be made to:{' '} + + https://api.covidtracking.com + +

)