diff --git a/09s-creating-a-meteor-package.md.erb b/09s-creating-a-meteor-package.md.erb index 3c54d2d..0521f44 100644 --- a/09s-creating-a-meteor-package.md.erb +++ b/09s-creating-a-meteor-package.md.erb @@ -114,6 +114,9 @@ Meteor.call('postInsert', post, function(error, result) { // affiche l'erreur à l'utilisateur Errors.throw(error.reason); + // affiche ce résultat mais route quand même + if (result.postExists) + Errors.throw('Ce lien à déjà été utilisé'); ~~~ <%= caption "client/templates/posts/post_submit.js" %> @@ -123,9 +126,6 @@ Posts.update(currentPostId, {$set: postProperties}, function(error) { // Afficher l'erreur à l'utilisateur Errors.throw(error.reason); - // affiche ce résultat mais route quand même - if (result.postExists) - Errors.throw('Ce lien à déjà été utilisé'); ~~~ <%= caption "client/templates/posts/post_edit.js" %> <%= highlight "4,8" %>