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

[#0608] Detalhes da reunião #20

Closed gioliveirass closed 1 year ago

gioliveirass commented 1 year ago

Descrição da atividade

Criar rota para retornar informações de uma reuniões em específico.

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

Detalhes da Reunião

image


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

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

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

        return this.meetingService.findById(id);
    }
async findById(id: string) {
  return this.prismaService.meeting.findUnique({
      where: {
            id
      },
      select: {
              id: true,
              title: true,
              description: true,
              meetingDateTime: true,
              Partner: {
                select: {
                  id: true,
                  name: true,
                  email: true,
                  phoneNumber: true,
                  status: true
              }
            },
            meetingComments: true,
          },
  });
    }
gioliveirass commented 1 year ago

@drisabelles @GabrielCamargoL mto bom