feat(backend): add Swagger decorators for enriched portfolio list
This commit is contained in:
parent
f0e5e36b7d
commit
a8b3b55896
@ -1,5 +1,6 @@
|
|||||||
import { Controller, Get, Post, Patch, Delete, Body, Param, ParseIntPipe } from '@nestjs/common';
|
import { Controller, Get, Post, Patch, Delete, Body, Param, ParseIntPipe } from '@nestjs/common';
|
||||||
import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger';
|
import { ApiTags, ApiOperation, ApiBearerAuth, ApiOkResponse } from '@nestjs/swagger';
|
||||||
|
import { PortfolioListResponseDto } from './dto/portfolio-list-response.dto';
|
||||||
import { PortfolioService } from './portfolio.service';
|
import { PortfolioService } from './portfolio.service';
|
||||||
import { CreatePortfolioDto } from './dto/create-portfolio.dto';
|
import { CreatePortfolioDto } from './dto/create-portfolio.dto';
|
||||||
import { UpdatePortfolioDto } from './dto/update-portfolio.dto';
|
import { UpdatePortfolioDto } from './dto/update-portfolio.dto';
|
||||||
@ -15,6 +16,7 @@ export class PortfolioController {
|
|||||||
|
|
||||||
@Get()
|
@Get()
|
||||||
@ApiOperation({ summary: 'Get all portfolios for current user' })
|
@ApiOperation({ summary: 'Get all portfolios for current user' })
|
||||||
|
@ApiOkResponse({ type: PortfolioListResponseDto, isArray: true })
|
||||||
async findAll(@CurrentUser() user: { sub: number }) {
|
async findAll(@CurrentUser() user: { sub: number }) {
|
||||||
const portfolios = await this.portfolioService.findAll(user.sub);
|
const portfolios = await this.portfolioService.findAll(user.sub);
|
||||||
return { data: portfolios, meta: { cachedAt: null, fromCache: false } };
|
return { data: portfolios, meta: { cachedAt: null, fromCache: false } };
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user