Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AQI->PM25 fix #39

Merged
merged 4 commits into from
Aug 9, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use pm25 level instead of API
  • Loading branch information
amaury1093 committed Aug 9, 2018
commit e6696761df34ea4c6536659b255750ac264ca66d
5 changes: 5 additions & 0 deletions App/utils/dataSources/windWaqi.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ const windWaqi = async ({ latitude, longitude }) => {

if (response.d && response.d.length) {
const data = response.d[0];

if (data.pol !== 'pm25') {
throw new Error('PM2.5 not defined in response.');
}

return { pm25: data.v, city: { geo: data.geo, name: data.nlo } };
} else {
throw new Error(response);
Expand Down