The-Bugger-Ducks / owl-partners-back

API do projeto "Owl Partners" (5º DSM - 2023, FATEC Profº Jessen Vidal - SJC)
https://owlpartners.onrender.com/api
2 stars 0 forks source link

Feature/#13 metting comments #36

Closed ThHenrique closed 1 year ago

ThHenrique commented 1 year ago

Documentação

Tecnologias

NestJS, Prisma, PostgresSQL, Insomnia, VSCODE, beekeeper Studio portable

Descrição

CRUD de anotações das reuniões.

Issues Relacionada

22 #23 #24

Lista de Mudanças

Rotas

para visualizar as rotas, utilize o swagger e veja a aba "Meetings" em (http://localhost:3000/api)[localhost:3000/api].


Comentários Adicionais

A atualização do comentário da reunião só poderá ser feita pelo usuário que realizou a ação

async update(@Param('commentId') commentId: string, @Body() commentData: UpdateMeetingCommentDTO, @Request() req) {
        const user: User = req.user;

        const meetingCommentFound = await this.meetingCommentService.findById(commentId);

        if (meetingCommentFound === null) {
            throw new NotFoundException('Comentário da reunião não encontrado');
        } else if (meetingCommentFound.User.id !== user.id) {
            throw new UnauthorizedException('Somente o usuário que criou o comentário pode editá-la.');
        }

        const meetingCommentUpdated = await this.meetingCommentService.update(commentId, commentData);

        return {
            meetingComment: meetingCommentUpdated,
            message: 'Comentário da reunião Atualizado com sucesso.',
        };
    }

Checklist