Explorar o código

Fixed issue with resolving reports

theflametrooper %!s(int64=8) %!d(string=hai) anos
pai
achega
e76c02e22b
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

@@ -98,7 +98,11 @@ module.exports = {
 
 			(report, next) => {
 				if (!report) return next('Report not found.');
-				report.update({ _id: reportId }, next);
+				report.resolved = true;
+				report.save(err => {
+					if (err) next(err.message);
+					else next();
+				});
 			}
 		], (err) => {
 			if (err) {