This file contains 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
[alias] | |
acm = "!f() { git add . && git commit -m \"$(echo $@)\"; }; f"; | |
com = checkout master | |
cob = checkout -b | |
b = branch | |
p = push | |
pl = pull | |
s = status |
This file contains 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
[alias] | |
acm = "!f() { git add . && git commit -m \"$(echo $@)\"; }; f"; | |
com = checkout master | |
cob = checkout -b | |
b = branch | |
p = push | |
pl = pull | |
s = status |
This file contains 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
document.body.addEventListener('keydown', function(e) { | |
if(!(e.keyCode == 13 && (e.metaKey || e.ctrlKey))) return; | |
var target = e.target; | |
if(target.form) { | |
target.form.submit(); | |
} | |
}); |
This file contains 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 { Body, Controller, Post } from '@nestjs/common'; | |
import { AppService } from './app.service'; | |
@Controller() | |
export class AppController { | |
constructor(private readonly appService: AppService) {} | |
@Post('/customer') | |
registerCustomer(@Body() body: any) { | |
return body; |
This file contains 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 { Body, Controller, Post } from '@nestjs/common'; | |
import { AppService } from './app.service'; | |
import { CreateCustomerDto } from './dto/create-customer.dto'; | |
@Controller() | |
export class AppController { | |
constructor(private readonly appService: AppService) {} | |
@Post('/customer') | |
registerCustomer(@Body() body: CreateCustomerDto) { |
This file contains 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 { NestFactory } from '@nestjs/core'; | |
import { AppModule } from './app.module'; | |
import { ValidationPipe } from '@nestjs/common'; | |
import { | |
ValidationFilter, | |
exceptionFactory, | |
} from './exceptions/validation.filter'; | |
async function bootstrap() { | |
const app = await NestFactory.create(AppModule); |
This file contains 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 { Type } from 'class-transformer'; | |
import { IsEmail, IsNotEmpty, ValidateNested } from 'class-validator'; | |
class AddressCustomerType { | |
@IsNotEmpty() | |
city: string; | |
@IsNotEmpty() | |
address: string; | |
} |