Skip to content

Commit

Permalink
dont group issues as doing it in the query
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeGoodall committed Dec 12, 2024
1 parent 82eb4bf commit 99235f0
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions src/middleware/datasetTaskList.middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,7 @@ export const prepareTasks = (req, res, next) => {

const issues = [...entryIssueCounts, ...entityIssueCounts]

const groupedIssues = issues.reduce((acc, issue) => {
const { field, issue_type: type } = issue
const key = `${field}_${type}`
if (acc[key]) {
acc[key].count += 1
} else {
acc[key] = {
type,
field,
count: 1
}
}
return acc
}, {})

req.taskList = Object.values(groupedIssues).map(({ field, type, count }) => {
req.taskList = Object.values(issues).map(({ field, issue_type: type, count }) => {
// if the issue doesn't have an entity, or is one of the special case issue types then we should use the resource_row_count

let rowCount = entityCount
Expand Down

0 comments on commit 99235f0

Please sign in to comment.