Created
March 27, 2025 18:39
-
-
Save Vatsalya-singhi/2160599762bb9b67a4339d44918e1a1d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Controller, Post, Body, UsePipes, ValidationPipe } from '@nestjs/common'; | |
import { CreateUserDto } from './create-user.dto'; | |
@Controller('users') | |
export class UsersController { | |
@Post() | |
@UsePipes(new ValidationPipe()) // Apply validation | |
create(@Body() createUserDto: CreateUserDto) { | |
return { message: 'User created', data: createUserDto }; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment