Created
December 18, 2015 22:03
-
-
Save mikemurray/e6bf3e63eefebfb51922 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ReactionCore.MethodHooks.before("workflow/pushOrderWorkflow", function (options) { | |
check(options, Match.OrderHookOptions); | |
console.log("workflow/pushOrderWorkflow: About to check status", options); | |
let workflow = options.arguments[0]; | |
let status = options.arguments[1]; | |
let order = options.arguments[2]; | |
if (Meteor.server.method_handlers[workflow]) { | |
let result = Meteor.call(`workflow/${workflow}/${status}`, options); | |
if (result === false) { | |
throw new Meteor.Error(403, 'Permission denied.'); | |
} | |
} | |
}); | |
ReactionCore.MethodHooks.after("workflow/pushOrderWorkflow", function (options) { | |
check(options, Match.OrderHookOptions); | |
/* | |
let workflow = options.arguments[0]; | |
let status = options.arguments[1]; | |
let order = options.arguments[2]; | |
*/ | |
return options.result; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment