From b459d31e3b334500abd6aeed2d81dcc20a8e01e6 Mon Sep 17 00:00:00 2001 From: Moran Date: Mon, 9 Feb 2026 14:13:15 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20corrige=20exporta=C3=A7=C3=A3o=20splinke?= =?UTF-8?q?r?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/splinker-controller.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/controllers/splinker-controller.js b/src/controllers/splinker-controller.js index 7f188b4f..9e7d9ca5 100644 --- a/src/controllers/splinker-controller.js +++ b/src/controllers/splinker-controller.js @@ -56,7 +56,6 @@ const obterModeloSPlinkerLotes = async (limit, offset, request, response) => { 'especie_id', 'genero_id', 'familia_id', - 'reino_id', 'sub_familia_id', 'sub_especie_id', 'colecao_anexa_id', @@ -96,11 +95,13 @@ const obterModeloSPlinkerLotes = async (limit, offset, request, response) => { { model: TomboFoto, }, - { - model: Reino, - }, { model: Familia, + include: [ + { + model: Reino, + }, + ], }, { model: Genero, @@ -133,7 +134,7 @@ const obterModeloSPlinkerLotes = async (limit, offset, request, response) => { }); tombos.forEach(tombo => { - const kingdom = tombo.reino?.nome || ' '; + const kingdom = tombo.familia?.reino?.nome || ' '; const family = tombo.familia?.nome || ' '; const genus = tombo.genero?.nome || ' '; const species = tombo.especy?.nome || ' '; @@ -219,9 +220,7 @@ export const obterModeloSPLinker = async (request, response, next) => { const limit = request.query.limit > 1000 ? 1000 : request.query.limit || 1000; - const quantidadeTombos = await Tombo.count( - { distinct: true }, - ); + const quantidadeTombos = await Tombo.count({ col: 'hcf' }); response.set({ 'Content-Type': 'text/plain',