mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-30 18:30:32 -06:00
fix: make getSummary response call synchronous to avoid db issues (#4564)
This commit is contained in:
@@ -907,12 +907,11 @@ export const getSurveySummary = reactCache(
|
||||
|
||||
const pages = Math.ceil(filteredResponseCount / batchSize);
|
||||
|
||||
const responsesArray = await Promise.all(
|
||||
Array.from({ length: pages }, (_, i) => {
|
||||
return getResponses(surveyId, batchSize, i * batchSize, filterCriteria);
|
||||
})
|
||||
);
|
||||
const responses = responsesArray.flat();
|
||||
let responses: TResponse[] = [];
|
||||
for (let i = 0; i < pages; i++) {
|
||||
const batchResponses = await getResponses(surveyId, batchSize, i * batchSize, filterCriteria);
|
||||
responses = responses.concat(batchResponses);
|
||||
}
|
||||
|
||||
const responseIds = hasFilter ? responses.map((response) => response.id) : [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user