This repository has been archived by the owner on May 23, 2023. It is now read-only.
[BUG]: Busca vazia quebra o service #34
Labels
bug
Something isn't working
good first issue
Good for newcomers
help wanted
Extra attention is needed
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.
The text was updated successfully, but these errors were encountered: