0.1.3 • Published 6 months ago
prisma-nest-dto v0.1.3
Screenshot
Live Playground
A live playground is hosted on GitHub Pages.
How to install
npm install prisma-nest-dto
yarn add prisma-nest-dto
How to use
Step1 (cli generate code)
npx pnd
yarn pnd
Step2 (import DTO)
import { Controller, Get, Query, Post, Body } from "@nestjs/common";
import { YourModel as YourModelDto } from "prisma-nest-dto/dto";
@Controller("/")
export class AppController {
constructor() {}
@Get("foo")
public async foo(@Query() query: YourModelDto) {
return {};
}
@Post("bar")
public async bar(@Body() body: YourModelDto) {
return {};
}
}
Todo list
- Generate class-validator annotations using comment