Dup subscriptions not allowed
This commit is contained in:
parent
621cf4e2ad
commit
e703057377
4 changed files with 13 additions and 3 deletions
|
|
@ -25,6 +25,10 @@ Meteor.methods({
|
|||
...doc
|
||||
};
|
||||
// console.log(newDoc);
|
||||
const already = Subscriptions.findOne(newDoc);
|
||||
if (already) {
|
||||
throw new Meteor.Error('500', 'on-already-subscribed');
|
||||
}
|
||||
return Subscriptions.insert(newDoc);
|
||||
} catch (exception) {
|
||||
console.error(exception);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue