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

No access to meteor methods result #12

Open
FoudreNoire26i opened this issue Aug 12, 2021 · 0 comments
Open

No access to meteor methods result #12

FoudreNoire26i opened this issue Aug 12, 2021 · 0 comments

Comments

@FoudreNoire26i
Copy link

Hi,
I'm am trying to use your package, it is working, but i have a little problem, when I define before or after hooks, I doesn't have access to Meteor methods result, indeed I can only get function arguments, but on this forum https://forums.meteor.com/t/new-method-hooks/8304 I saw that i can have the arguments and the function result.
My hook looks like this :
Meteor.afterMethod('createProject', (argObject, result) => { console.log("-----"); console.log(argObject); console.log(result); console.log("-----"); })

and my meteor methods :
Meteor.methods({ 'createProject' : function(projectInfo) { return Projects.insert({ title : projectInfo.title ?? '', description : projectInfo.description ?? '', type : projectInfo.type ?? '', domain : projectInfo.domain ?? '', userFirstName : projectInfo.userFirstName ?? "", userLastName : projectInfo.userLastName ?? "", userMail : projectInfo.userMail ?? "", userTel : projectInfo.userTel ?? "", userSituation : projectInfo.userSituation ?? "", termAndCondition : projectInfo.termAndCondition ?? false, nextActionDate : new Date().toLocaleString('fr-FR'), status : 'Nouveau', }) /*} else { console.log("can't create Project with no account") return -1 }*/ })

Thanks

@FoudreNoire26i FoudreNoire26i changed the title No access to return of meteor methods No access to meteor methods result Aug 12, 2021
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

1 participant