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

[#0610] Exclusão de reunião #21

Closed gioliveirass closed 1 year ago

gioliveirass commented 1 year ago

Descrição da atividade

Criar rota para deletar uma reunião.

Informações para execução da atividade

DoR

DoD

GabrielCamargoL commented 1 year ago

Documentação

Tecnologias

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

Exclusão da Reunião

image


URL: domain.api.com.br/meetings/:id Method: DELETE

@Delete('/:id')
    @UseGuards(AuthGuard('jwt'))
    async deleteMeeting(@Param('id') id: string) {
        const meetingFound = await this.meetingService.findById(id);

        if (meetingFound === null) throw new NotFoundException('Reunião não encontrada.');

        await this.meetingService.delete(id);
        return { message: 'Reunião deletada com sucesso.' };
    }
delete(id: string) {
  return this.prismaService.meeting.delete({
    where: {
      id: id,
    },
  });
  }
gioliveirass commented 1 year ago

@drisabelles @GabrielCamargoL show