The-Bugger-Ducks / owl-partners-mobile

Mobile do projeto "Owl Partners" (5º DSM - 2023, FATEC Profº Jessen Vidal - SJC)
1 stars 0 forks source link

List and add meeting comments #53

Closed MariaGabrielaReis closed 1 year ago

MariaGabrielaReis commented 1 year ago

Documentação

Foi usado a classe para agrupar as requisições que envolvem as reuniões, onde existe uma função para listar as anotações de uma reunião e outra para criação delas.

Tecnologias: React Native, Expo, Axios, Styled Components

https://user-images.githubusercontent.com/69374340/233804642-cc5e361d-78af-4d64-9e16-bcae175ac59d.mp4

https://user-images.githubusercontent.com/69374340/233805206-a516b965-cdf7-4f1b-a6ab-a10061ee583a.mp4

Requisição para listar comentários da reunião

 async getMeetingComments(id: string) {
    try {
      const { data } = await api.get(MEETING_ENDPOINTS.COMMENTS + id);
      return data;
    } catch (error) {
      alertError(
        error,
        "Não foi possível carregar os comentários da reunião :(",
      );
    }
  }

Requisição para criar um comentário

 async createMeetingComment(
    meetingId: string,
    comment: string,
    userId: string,
  ) {
    try {
      const payload = {
        comment,
        meetingId,
        userId,
      };
      const { data } = await api.post(MEETING_ENDPOINTS.ADD_COMMENT, payload);
      return data;
    } catch (error) {
      alertError(error, "Não foi possível cadastrar o comentário :(");
    }
  }