Reverts calling next() after handling response (#2634)

* Revert "Makes sure routes don't overlap and yield a header set error"

* removes next() calls in PromiseRouter

* Reverts calling next() after response

* Adds fail calls when next() calls traverse tests
This commit is contained in:
Florent Vilmart
2016-09-09 17:28:41 -04:00
committed by GitHub
parent 7f6fb11d78
commit ac348f5c4f
7 changed files with 20 additions and 26 deletions

View File

@@ -1,8 +1,6 @@
import AdaptableController from './AdaptableController';
import { AnalyticsAdapter } from '../Adapters/Analytics/AnalyticsAdapter';
const AppOpenedEventName = 'AppOpened';
export class AnalyticsController extends AdaptableController {
appOpened(req) {
return Promise.resolve().then(() => {
@@ -15,12 +13,8 @@ export class AnalyticsController extends AdaptableController {
}
trackEvent(req) {
const eventName = req.params.eventName;
if (eventName === AppOpenedEventName) {
return this.appOpened(req);
}
return Promise.resolve().then(() => {
return this.adapter.trackEvent(eventName, req.body, req);
return this.adapter.trackEvent(req.params.eventName, req.body, req);
}).then((response) => {
return { response: response || {} };
}).catch((err) => {