deleteSubmissions - remove spurious condition

`FormSubmission.remove` should not use `admin` as a condition:
 - the field is not present in the schema or in any created submissions
 - the user is unlikely to be the admin of a submission 

Remove this field to facilitate deletes

Fixes #315
This commit is contained in:
LoneRifle 2018-10-20 16:33:12 +08:00 committed by GitHub
parent 188705b640
commit 5bc0d623a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,7 @@ exports.deleteSubmissions = function(req, res) {
var submission_id_list = req.body.deleted_submissions,
form = req.form;
FormSubmission.remove({ form: req.form, admin: req.user, _id: {$in: submission_id_list} }, function(err){
FormSubmission.remove({ form: req.form, _id: {$in: submission_id_list} }, function(err){
if(err){
res.status(400).send({