From 384f28bdb18e4f0545679291c83d7971eff9c44a Mon Sep 17 00:00:00 2001 From: Christian Parker Date: Tue, 19 Mar 2024 15:59:48 -0700 Subject: [PATCH] hotfix: some parsing issues from the new request method --- src/adapters/adairquality.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/adapters/adairquality.js b/src/adapters/adairquality.js index 5b7a7eb6..5fffdf0f 100644 --- a/src/adapters/adairquality.js +++ b/src/adapters/adairquality.js @@ -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'; @@ -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;