Skip to content

Commit b04c3ed

Browse files
committed
[BACK-2685] always fetch latest settings for date bound reports
1 parent c00c2e5 commit b04c3ed

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

lib/report.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,26 @@ class Report {
702702
fetchConfig,
703703
);
704704

705+
if (this.#reportDates) {
706+
// fetch the latest pump settings record for date bound reports
707+
const pumpSettingsFetch = await fetchUserData(
708+
this.#userDetail.userId,
709+
{
710+
headers: this.#requestData.sessionHeader,
711+
params: {
712+
type: 'pumpSettings',
713+
latest: 1,
714+
},
715+
},
716+
).catch((error) => {
717+
this.#log.error(error);
718+
});
719+
720+
if (pumpSettingsFetch?.length > 0) {
721+
userData.push(pumpSettingsFetch[0]);
722+
}
723+
}
724+
705725
this.#log.debug(`Downloading data for User ${this.#userDetail.userId}...`);
706726

707727
this.#log.debug('add data to dataUtil');

0 commit comments

Comments
 (0)