[refactor] /util to /strategies

This commit is contained in:
Muthu Kumar
2018-11-27 22:36:29 +05:30
parent 1199d4e20d
commit abf043a27a
9 changed files with 54 additions and 52 deletions
-10
View File
@@ -1,10 +0,0 @@
module.exports = app => {
app.get("/webhook/:provider", (req, res) => {
const strategy = req.params.provider;
const eventType = req.convert.getEvent[strategy](req.body);
});
};
+10
View File
@@ -0,0 +1,10 @@
module.exports = app => {
app.get("/webhook/:provider", (req, res) => {
const { provider } = req.params;
const eventType = req.strategies[provider].getEvent(req.body);
});
};