routing-controllers icon indicating copy to clipboard operation
routing-controllers copied to clipboard

redirect not working with interceptor

Open guysaar223 opened this issue 4 years ago • 0 comments

redirect not working with interceptor class:

Interceptor class:

@Interceptor()
export class Json implements InterceptorInterface {
  intercept(action: Action, content: any) {
    const { statusCode } = action.response;
    return {
      httpCode: statusCode,
      message: 'ok',
      payload: content,
    }
  }
};
@Get('/github')
  @Redirect('http://github.com/:owner/:repo')
  getUsers() {
    return {
      owner: 'pleerock',
      repo: 'routing-controllers',
    }
  }

getting error: Could not find url parameter owner in passed options object

guysaar223 avatar Jun 21 '20 23:06 guysaar223