Artteiv's picture
feat: add feeds
2fc4f90
import {
Controller,
Get,
Post,
Body,
Patch,
Param,
Delete,
} from '@nestjs/common';
import { FeedsService } from './feeds.service.js';
import { CreateFeedDto } from './dto/create-feed.dto.js';
import { UpdateFeedDto } from './dto/update-feed.dto.js';
import { Public } from '../authentication/authentication.decorator.js';
import { Paginate, PaginateQuery } from 'nestjs-paginate';
@Public()
@Controller('feeds')
export class FeedsController {
constructor(private readonly feedsService: FeedsService) {}
@Post()
create(@Body() createFeedDto: CreateFeedDto) {
return this.feedsService.create(createFeedDto);
}
@Get()
findAll(@Paginate() paginateQuery: PaginateQuery) {
return this.feedsService.findAll(paginateQuery);
}
@Get(':id')
findOne(@Param('id') id: string) {
return this.feedsService.findOne(+id);
}
@Patch(':id')
update(@Param('id') id: string, @Body() updateFeedDto: UpdateFeedDto) {
return this.feedsService.update(+id, updateFeedDto);
}
@Delete(':id')
remove(@Param('id') id: string) {
return this.feedsService.remove(+id);
}
}