Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onSuccess hook working for 'update' but not for 'remove' operation. #73

Open
sanelo opened this issue Dec 29, 2015 · 1 comment
Open

Comments

@sanelo
Copy link

sanelo commented Dec 29, 2015

I am using both update and remove modals on a single page. They both work as intended, however, when I try adding onSuccess hooks, it only works for the update operation, not the remove operation.

Here's my code in the template:

{{#if editOk}}
    {{#afModal class="btn btn-primary" collection="Jobs" operation="update" doc=job._id formId="UpdateJobForm"}}
      Update post
    {{/afModal}}

    {{#afModal class="btn btn-deny" collection="Jobs" operation="remove" doc=job._id formId="RemoveJobForm"}}
      Delete Post
    {{/afModal}}
{{/if}}

Here's the JS:

AutoForm.addHooks(['UpdateJobForm', 'RemoveJobForm'], {
  onSuccess: function(operation, result, template) {
    alert('Success!');
  }
});

Am I missing something here?

@noahsw
Copy link

noahsw commented Feb 14, 2016

+1. I tried using the inline onSuccess but then ran into this problem: #79

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants