Move decrementing to server and out of observe hook

This commit is contained in:
Erik Ziegler committed 2016-01-11 19:47:19 +01:00
1 parent fdde2f9ff9
commit 906f7c6234
2 files changed
+27 -34

No files matched your search

@@ -1,13 +1,7 @@
Meteor.methods({
removeMeasurement: function(id) {
Measurements.remove(id);
},
removeMeasurementsByPatientId: function(patientId) {
Measurements.remove({
patientId: patientId
});
},
decrementLesionNumbers: function(lesionData) {
var lesionData = Measurements.findOne(id);
// Update all Measurements to decrement the lesion numbers for those
// that were created after the current lesion by 1
@@ -42,5 +36,12 @@ Meteor.methods({
}, {
multi: true
});
Measurements.remove(id);
},
removeMeasurementsByPatientId: function(patientId) {
Measurements.remove({
patientId: patientId
});
}
});