-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
TS error on use @HttpStatus() #315
Comments
and I think what you are looking for is import { Controller, Get, Post, HttpStatus, HttpCode, HttpException } from '@nestjs/common';
@Controller('cats')
export class CatsController {
@Post()
@HttpCode(204)
create() {
// Add New Cat..
}
@Get()
findAll() {
return new HttpException('Nothing Here !', HttpStatus.NO_CONTENT);
}
} |
Yeap, just notice that ) Should fix - https://docs.nestjs.com/controllers . Tnx for help. |
Example in docs contains |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I'm submitting a...
Current behavior
Make simple nestjs project like in tutorial.
Take this example code.
And get this error:
Expected behavior
Everithing is ok. Cause it in tutorial.
Minimal reproduction of the problem with instructions
Download nestjs starter project and copy-paste above controller's code.
What is the motivation / use case for changing the behavior?
Environment
The text was updated successfully, but these errors were encountered: