Open SaladFork opened 7 years ago
Your relationship is async, thus your initial let author = post.get('author')
is returning a promise, which you cannot call an action on.
However, if you changed it to
post.get('author').then((author) => {
author.highFive();
});
I'm guessing it will work fine
I have this function called on click of button
runTestCases(ruleSetVersion) {
ruleSetVersion.runTestCasesNow().then(response => {
this.sendAction('runTestCases', response)
}).then(() => this.set('model', null))
},
it is never getting resolved.
runTestCasesNow: memberAction({
path: 'run_test_cases',
type: 'post', // HTTP POST request
urlType: 'findRecord', // Base of the URL that's generated for the action
after(response) {
console.log("It is resolved", response) // not this one as well
}
}),
Basically, the after-hook is not getting triggered
Assume you have models
Person
andPost
, with the latter having a relationship to the former throughauthor
:If we define an API action on
Person
:Trying to call it through the relationship a few different ways seems to fail:
Error thrown from this line.