From 803fc6752d9ee91c3ba4e74e8d606313d4ac8914 Mon Sep 17 00:00:00 2001 From: sveisvei Date: Mon, 5 Dec 2016 17:58:29 +0100 Subject: [PATCH] send toggleName back --- lib/routes/event.js | 8 ++++++-- shift.sh | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 shift.sh diff --git a/lib/routes/event.js b/lib/routes/event.js index ea6bcc4b16..8afb4db65d 100644 --- a/lib/routes/event.js +++ b/lib/routes/event.js @@ -14,10 +14,14 @@ module.exports = function (app, config) { }); app.get('/events/:name', (req, res) => { - eventStore.getEventsFilterByName(req.params.name).then(events => { + const toggleName = req.params.name; + eventStore.getEventsFilterByName(toggleName).then(events => { if (events) { eventDiffer.addDiffs(events); - res.json(events); + res.json({ + toggleName, + events, + }); } else { res.status(404).json({ error: 'Could not find events' }); } diff --git a/shift.sh b/shift.sh new file mode 100644 index 0000000000..8f8292e454 --- /dev/null +++ b/shift.sh @@ -0,0 +1,38 @@ +jscodeshift \ +-t ../js-codemod/transforms/no-vars.js \ +packages/ --ignore-pattern=node_modules --extensions=js,jsx \ +&& \ +jscodeshift \ +-t ../js-codemod/transforms/object-shorthand.js \ +packages/ --ignore-pattern=node_modules --extensions=js,jsx \ +&& \ +jscodeshift \ +-t ../js-codemod/transforms/template-literals.js \ +packages/ --ignore-pattern=node_modules --extensions=js,jsx \ +&& \ +jscodeshift \ +-t ../js-codemod/transforms/unchain-variables.js \ +packages/ --ignore-pattern=node_modules --extensions=js,jsx \ +&& \ +jscodeshift \ +-t ../js-codemod/transforms/unquote-properties.js \ +packages/ --ignore-pattern=node_modules --extensions=js,jsx \ +&& \ +jscodeshift \ +-t ../js-codemod/transforms/arrow-function.js \ +packages/ --ignore-pattern=node_modules --extensions=js,jsx \ +&& \ +jscodeshift \ +-t ../js-codemod/transforms/use-strict.js \ +packages/ --ignore-pattern=node_modules --extensions=js,jsx \ + + + + +&& \ +jscodeshift \ +-t ../js-codemod/transforms/trailing-commas.js \ +packages/ --ignore-pattern=node_modules --extensions=js,jsx \ + + +