Explorar o código

Fixed issue with issues that have empty reasons still showing

theflametrooper %!s(int64=8) %!d(string=hai) anos
pai
achega
cba7440bd0
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      backend/logic/actions/reports.js

+ 5 - 1
backend/logic/actions/reports.js

@@ -113,10 +113,14 @@ module.exports = {
 			},
 			
 			(next) => {
+				let issues = [];
+
 				for (let r = 0; r < data.issues.length; r++) {
-					if (data.issues[r].reasons.length === 0) data.issues.splice(r, 1);
+					if (!data.issues[r].reasons.length <= 0) issues.push(data.issues[r]);
 				}
 
+				data.issues = issues;
+
 				next();
 			},