Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/controllers/locais-coleta-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@
export const buscarLocaisColeta = async (request, response, next) => {
try {
const { cidade_id: cidadeId } = request.query;
const { limite, pagina, offset } = request.paginacao;
//const { limite, pagina, offset } = request.paginacao;

const where = {};
if (cidadeId) {
where.cidade_id = cidadeId;
}

const { count, rows } = await LocalColeta.findAndCountAll({

Check failure on line 145 in src/controllers/locais-coleta-controller.js

View workflow job for this annotation

GitHub Actions / lint

'count' is assigned a value but never used

Check warning on line 145 in src/controllers/locais-coleta-controller.js

View workflow job for this annotation

GitHub Actions / lint

'count' is assigned a value but never used
where,
include: [
{ model: Cidade,
Expand All @@ -156,16 +156,16 @@
},
{ model: FaseSucessional },
],
limit: limite,
offset,
//limit: limite,
//offset,
});

response.status(200).json({
metadados: {
total: count,
pagina,
limite,
},
// metadados: {
// total: count,
// pagina,
// limite,
// },
resultado: rows,
});
} catch (error) {
Expand Down
1 change: 0 additions & 1 deletion src/routes/locais.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import listagensMiddleware from '../middlewares/listagens-middleware';

Check failure on line 1 in src/routes/locais.js

View workflow job for this annotation

GitHub Actions / lint

'listagensMiddleware' is defined but never used
import tokensMiddleware, { TIPOS_USUARIOS } from '../middlewares/tokens-middleware';
import validacoesMiddleware from '../middlewares/validacoes-middleware';
import localColetaCadastroEsquema from '../validators/localColeta-cadastro';
Expand Down Expand Up @@ -332,7 +332,6 @@
TIPOS_USUARIOS.OPERADOR,
TIPOS_USUARIOS.IDENTIFICADOR,
]),
listagensMiddleware,
validacoesMiddleware(localColetaListagemEsquema),
controller.buscarLocaisColeta,
]);
Expand Down
Loading