Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to support Nest 7 #32

Closed
chrene opened this issue Mar 25, 2020 · 2 comments · Fixed by #34
Closed

Migrate to support Nest 7 #32

chrene opened this issue Mar 25, 2020 · 2 comments · Fixed by #34

Comments

@chrene
Copy link

chrene commented Mar 25, 2020

With Nest 7 just released it would be helpful to have a new release that support it.

One thing that I noticed broke is the @UserRoles() decorator.
It can't find the user object on the request anymore since request is not passed into the create param decorator factory. createParamDecorator now expects a ExecutionContext instead.

From the migration docs

// Before
import { createParamDecorator } from '@nestjs/common';

export const User = createParamDecorator((data, req) => {
  return req.user;
});

// After
import { createParamDecorator, ExecutionContext } from '@nestjs/common';

export const User = createParamDecorator(
  (data: unknown, ctx: ExecutionContext) => {
    const request = ctx.switchToHttp().getRequest();
    return request.user;
  },
);
@rbutera
Copy link

rbutera commented May 20, 2020

Just stumbled upon this project. What’s the status on this migration? Are there more issues than #34 that need to be solved in order to be compatible with NestJS v7?

@ruslanguns
Copy link
Contributor

@rbutera so far I haven't seen any more issues yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants