Feat/boards#71
Conversation
… board management
…ipts for k6 testing
| ApiResponse({ | ||
| status: 201, | ||
| description: 'Представление создано', | ||
| type: BoardViewResponse.Output, |
There was a problem hiding this comment.
Мы даем ActionResponse, либо, расширяем, НО, в круде мы не отдаем конкретный пейлоад, зачем?
Держим 1 стиль, success, message -> фронт проверяет, if success then getDataSame()
Исправляй
| ApiResponse({ | ||
| status: 200, | ||
| description: 'Представление обновлено', | ||
| type: BoardViewResponse.Output, |
| ApiResponse({ | ||
| status: 200, | ||
| description: 'Представление удалено', | ||
| type: Boolean, |
There was a problem hiding this comment.
При удаление ресурса мы делаем просто ActionResponse dto
| constructor( | ||
| @Inject('IBoardsRepository') | ||
| private readonly boardsRepo: IBoardsRepository, | ||
| private readonly boardAccess: BoardAccessPolicy, |
There was a problem hiding this comment.
Нейминг держи относительно сущности, образно, если полиси проверяет доступ, делай как policyAccess, по импорту понятно что за бизнес-сущность
| public async execute(id: string, boardId: string, userId: string): Promise<boolean> { | ||
| await this.boardAccess.validateViewAccess(id, userId, boardId); | ||
|
|
||
| return this.boardsRepo.removeView(id); |
There was a problem hiding this comment.
Не забывай, статус и мессейдж, фронт ждет!
| @@ -0,0 +1,259 @@ | |||
| import { Inject, Injectable } from '@nestjs/common'; | |||
| import { IBoardsRepository } from '../../../domain/repository'; | |||
| import { | |||
There was a problem hiding this comment.
не забывай import type, тут конфиг линта настроить бы надо, на этот рул
| @Param('id') id: string, | ||
| @Param('boardId') boardId: string, | ||
| @GetUserId() userId: string, | ||
| ): Promise<BoardView | null> { |
There was a problem hiding this comment.
нет смысла явно указывать тип, он излишен, сваггер будет опираться на выведение декораторе тип
| ApiResponse({ | ||
| status: 201, | ||
| description: 'Колонка создана', | ||
| type: BoardColumnResponse.Output, |
| async findAll( | ||
| @Param('boardId') boardId: string, | ||
| @GetUserId() userId: string, | ||
| ): Promise<BoardColumn[]> { |
| ApiResponse({ | ||
| status: 201, | ||
| description: 'Доска успешно создана', | ||
| type: BoardResponse.Output, |
No description provided.