From ab75cf87205bb8da60113ac49e7cb09682606df1 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Tue, 29 Mar 2022 09:48:47 +0200 Subject: [PATCH] fix(core): update --- ts/typedrequest.classes.typedrouter.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ts/typedrequest.classes.typedrouter.ts b/ts/typedrequest.classes.typedrouter.ts index bf78d85..2fe26c0 100644 --- a/ts/typedrequest.classes.typedrouter.ts +++ b/ts/typedrequest.classes.typedrouter.ts @@ -87,7 +87,7 @@ export class TypedRouter { * @param typedRequestArg */ public async routeAndAddResponse(typedRequestArg: T): Promise { - if (!typedRequestArg?.correlation?.phase || typedRequestArg.correlation.phase === 'request') { + if (typedRequestArg?.correlation?.phase === 'request') { const typedHandler = this.getTypedHandlerForMethod(typedRequestArg.method); if (!typedHandler) { @@ -100,7 +100,8 @@ export class TypedRouter { } typedRequestArg = await typedHandler.addResponse(typedRequestArg); - } else if (typedRequestArg.correlation.phase === 'response') { + return typedRequestArg; + } else if (typedRequestArg?.correlation?.phase === 'response') { this.fireEventInterestMap .findInterest(typedRequestArg.correlation.id) ?.fullfillInterest(typedRequestArg); @@ -109,6 +110,5 @@ export class TypedRouter { console.log(typedRequestArg); return null } - return typedRequestArg; } }