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

Search bar (partnerships) #55

Closed drisabelles closed 1 year ago

drisabelles commented 1 year ago

Documentação

Issue relacionada: #32

Criação da barra de busca com a filtragem das parcerias.

Tecnologias: React Native, Expo, Axios, Styled Components

https://user-images.githubusercontent.com/79321198/233813710-0aee4ce6-08c0-4125-ab2f-3ce2b09f008c.mp4

Requisição para listar as parcerias por nome:

 async getPartnerships(disabled?: boolean, name?: string) {
    try {
      const { data } = name
        ? await api.get(
          PARTNERSHIP_ENDPOINTS.LIST +
              `?disabled=${disabled}` +
              `&name=${name}`,
        )
        : await api.get(PARTNERSHIP_ENDPOINTS.LIST + `?disabled=${disabled}`);
      return data;
    } catch (error) {
      alertError(error, "Não foi possível carregar a lista de parcerias :(");
    }
  }