Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

[BUG]: Busca vazia quebra o service #34

Open
kalado opened this issue May 26, 2020 · 0 comments
Open

[BUG]: Busca vazia quebra o service #34

kalado opened this issue May 26, 2020 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@kalado
Copy link

kalado commented May 26, 2020

Describe the bug
A busca que retorna vazia acaba quebrando o service porque não retorna metadata.

Expected behavior
Para retorno de buscas vazias, a API deve retornar status code 204.

Workaround
Tentei adicionar preserveNullAndEmptyArrays no src/helper/queryHelper.js
{ $unwind: { path: "$metadata", preserveNullAndEmptyArrays: true } }
Mas mesmo assim, é necessário tratar o total no service.
Precisa avaliar uma forma de retornar o total como zero, assim evita o tratamento fora do queryBuilder.

@lucas-a-pelegrino lucas-a-pelegrino added the bug Something isn't working label May 26, 2020
@lucas-a-pelegrino lucas-a-pelegrino added good first issue Good for newcomers help wanted Extra attention is needed labels Sep 25, 2020
@lucas-a-pelegrino lucas-a-pelegrino changed the title hotfix: Busca vazia quebra o service [BUG]: Busca vazia quebra o service Oct 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants