Fix left() response handling for parameter middleware

This commit is contained in:
Garrett Mills 2022-11-14 16:58:17 -06:00
parent 0484a586bd
commit 2d9f22b895
2 changed files with 6 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@extollo/lib",
"version": "0.14.7",
"version": "0.14.8",
"description": "The framework library that lifts up your code.",
"main": "lib/index.js",
"types": "lib/index.d.ts",

View File

@ -35,11 +35,13 @@ export class ExecuteResolvedRoutePreflightHTTPModule extends AbstractResolvedRou
}
const parameters = route.parameters
const resolveResult = await collect(parameters)
.asyncMapRight(handler => handler(request))
const resolveResult = (await collect(parameters)
.asyncMapRight(handler => handler(request)))
if ( isLeft(resolveResult) ) {
return unleft(resolveResult)
await this.applyResponseObject(unleft(resolveResult), request)
request.response.blockingWriteback(true)
return request
}
route.resolvedParameters = unright(resolveResult).toArray(false)