Answers for "nestjs controller"

0

nestjs controller

import { Controller, Get, Post, Body } from '@nestjs/common';
import { CreateCatDto } from './dto/create-cat.dto';
import { CatsService } from './cats.service';
import { Cat } from './interfaces/cat.interface';

@Controller('cats')
export class CatsController {
  constructor(private catsService: CatsService) {}

  @Post()
  async create(@Body() createCatDto: CreateCatDto) {
    this.catsService.create(createCatDto);
  }

  @Get()
  async findAll(): Promise<Cat[]> {
    return this.catsService.findAll();
  }
}
Posted by: Guest on January-06-2021
-1

netjs dto

interface IUsers {
	readonly user_id?: number
	readonly email: string
	readonly password: string
	readonly active?: boolean
	readonly created_at?: any
	readonly updated_at?: any
}

class UsersDTO implements IUsers {
	readonly user_id?: number
	readonly email: string
	readonly password: string
	readonly active?: boolean
	readonly created_at?: any
	readonly updated_at?: any
}
Posted by: Guest on December-31-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language