You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
674 B

import { Body, Controller, Get, Param, Post, UseGuards } from '@nestjs/common';
import { SeasonsService } from './seasons.service';
import { AuthGuard } from 'src/auth/auth.guard';
2 years ago
@Controller('seasons')
export class SeasonsController {
constructor(
private seasonsService: SeasonsService
) {}
2 years ago
@Get()
findAll() {
return this.seasonsService.findAll();
}
@Get(':id')
findOne(@Param() params: any) {
return this.seasonsService.findOne(params.id);
2 years ago
}
@UseGuards(AuthGuard)
@Post()
create(@Body() body: any) {
return this.seasonsService.create(body.title, body.subTitle, body.startingDate);
}
2 years ago
}