Meteor.call('postInsert', post, function(error, result) {
if (error) {
// display the error to the user
Errors.throw(error.reason);
for post_submit.js and:
Posts.update(currentPostId, {$set: postProperties}, function(error) {
if (error) {
// display the error to the user
Errors.throw(error.reason);
// show this result but route anyway
if (result.postExists)
Errors.throw('This link has already been posted');
for post_edit.js.
Instead it should be:
Meteor.call('postInsert', post, function(error, result) {
// display the error to the user and abort
if (error)
return Errors.throw(error.reason);
// show this result but route anyway
if (result.postExists)
Errors.throw('This link has already been posted');
for post_submit.js and:
Posts.update(currentPostId, {$set: postProperties}, function(error) {
if (error) {
// display the error to the user
Errors.throw(error.reason);
In 9.5 you have:
for
post_submit.js
and:for
post_edit.js
.Instead it should be:
for
post_submit.js
and:for
post_edit.js
.