Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
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
5 changes: 1 addition & 4 deletions src/controllers/reportController.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,7 @@ const createReportController = (reportType, { crossGeo = false } = {}) => {

// Execute query
const snapshot = await query.get();
const data = [];
snapshot.forEach(doc => {
data.push(doc.data());
});
const data = snapshot.docs.map(doc => doc.data());

// Send response with ETag support
const jsonData = JSON.stringify(data);
Expand Down
5 changes: 1 addition & 4 deletions src/utils/controllerHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,7 @@ const executeQuery = async (req, res, collection, queryBuilder, dataProcessor =
const query = await queryBuilder(params);
const snapshot = await query.get();

let data = [];
snapshot.forEach(doc => {
data.push(doc.data());
});
let data = snapshot.docs.map(doc => doc.data());

// Process data if processor provided
if (dataProcessor) {
Expand Down