Skip to content

Commit

Permalink
fix(rest): inject request context instead of the current one
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondfeng committed Jun 11, 2019
1 parent 7ddae8f commit e8c7ba6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/rest/src/actions/find-route.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {BaseRestAction} from './base-action';
@restAction('route')
export class FindRouteAction extends BaseRestAction {
constructor(
@inject.context()
@inject(RestBindings.Http.CONTEXT)
private context: Context,
@inject(RestBindings.HANDLER) protected httpHandler: HttpHandler,
) {
Expand Down
12 changes: 3 additions & 9 deletions packages/rest/src/actions/invoke-method.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,13 @@
import {Context, Getter, inject, Next} from '@loopback/context';
import {RestBindings} from '../keys';
import {RouteEntry} from '../router';
import {
HttpContext,
InvokeMethod,
OperationArgs,
RestAction,
restAction,
} from '../types';
import { BaseRestAction } from './base-action';
import {HttpContext, InvokeMethod, OperationArgs, restAction} from '../types';
import {BaseRestAction} from './base-action';

@restAction('invoke')
export class InvokeMethodAction extends BaseRestAction {
constructor(
@inject.context()
@inject(RestBindings.Http.CONTEXT)
private context: Context,
@inject.getter(RestBindings.RESOLVED_ROUTE)
protected getRoute: Getter<RouteEntry>,
Expand Down

0 comments on commit e8c7ba6

Please # to comment.