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