Switch to using push to add on read applications

Signed-off-by: Robert Bunning <rbunning@webstaurantstore.com>
This commit is contained in:
Robert Bunning
2023-08-07 15:41:55 -04:00
parent 7c8e57af3d
commit b6ee85d1e7
+2 -2
View File
@@ -103,7 +103,7 @@ export class NewRelicClient implements NewRelicApi {
}
try {
let applications: NewRelicApplication[] = [];
const applications: NewRelicApplication[] = [];
let targetUrl = this.baseUrl;
do {
@@ -111,7 +111,7 @@ export class NewRelicClient implements NewRelicApi {
await this.fetchNewRelic(targetUrl);
targetUrl = nextPageUrl ?? '';
applications = applications.concat(applicationsFromReadPage);
applications.push(...applicationsFromReadPage);
} while (!!targetUrl);
return { applications };