From 5b13cb4ad168162a2fb7b6dd917c0656d97a35bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Hr=C3=A1=C5=A1ek?= Date: Wed, 1 May 2019 12:36:53 +0200 Subject: [PATCH] Check if function is resource for async routes, solves #309 --- lib/director/router.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/director/router.js b/lib/director/router.js index 5f442eb..60a884b 100644 --- a/lib/director/router.js +++ b/lib/director/router.js @@ -426,6 +426,8 @@ Router.prototype.invoke = function (fns, thisArg, callback) { } else if (typeof fn == 'function') { fn.apply(thisArg, (fns.captures || []).concat(next)); + } else if (typeof fn === "string" && self.resource) { + self.resource[fn].apply(thisArg, (fns.captures || []).concat(next)); } }; _asyncEverySeries(fns, apply, function () {