Skip to content

Commit

Permalink
hotfix: some parsing issues from the new request method
Browse files Browse the repository at this point in the history
  • Loading branch information
caparker committed Mar 19, 2024
1 parent 82aa807 commit 384f28b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/adapters/adairquality.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import client from '../lib/requests.js';
import { DateTime } from 'luxon';
import { parallel } from 'async';
import flatMap from 'lodash/flatMap.js';
import log from '../lib/logger.js';

export const name = 'adairquality-ae';

Expand Down Expand Up @@ -275,7 +276,9 @@ function parseDate(dateString) {
function formatData(locations) {
let out = [];
for (const location of locations) {
const body = JSON.parse(location.body);
// body no longer needs to be parsed
const body = location.body;
// but the JSONDataResult does
const measurements = JSON.parse(body.JSONDataResult).map((o) => {
const date = parseDate(o.DateTime);
o.DateTime = date;
Expand Down

0 comments on commit 384f28b

Please sign in to comment.