From d80985beb2af16e55991a283a1ec37e80f97f1c5 Mon Sep 17 00:00:00 2001 From: yuriBaza23 Date: Wed, 6 Aug 2025 13:42:04 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20altera=C3=A7=C3=A3o=20na=20permiss=C3=A3?= =?UTF-8?q?o=20para=20rotas=20coletor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/coletor.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/routes/coletor.js b/src/routes/coletor.js index d16bd7e3..3dbd0056 100644 --- a/src/routes/coletor.js +++ b/src/routes/coletor.js @@ -1,6 +1,6 @@ import * as coletoresController from '../controllers/coletor-controller'; import listagensMiddleware from '../middlewares/listagens-middleware'; -import tokensMiddleware from '../middlewares/tokens-middleware'; +import tokensMiddleware, { TIPOS_USUARIOS } from '../middlewares/tokens-middleware'; import validacoesMiddleware from '../middlewares/validacoes-middleware'; import atualizarColetorEsquema from '../validators/coletor-atualiza'; import cadastrarColetorEsquema from '../validators/coletor-cadastro'; @@ -75,7 +75,7 @@ export default app => { * $ref: '#/components/responses/InternalServerError' */ app.route('/coletores').post([ - tokensMiddleware(['CURADOR']), + tokensMiddleware([TIPOS_USUARIOS.CURADOR]), validacoesMiddleware(cadastrarColetorEsquema), coletoresController.cadastraColetor, ]); @@ -121,7 +121,7 @@ export default app => { * $ref: '#/components/responses/InternalServerError' */ app.route('/coletores/:id').get([ - tokensMiddleware(['CURADOR']), + tokensMiddleware([TIPOS_USUARIOS.CURADOR]), coletoresController.encontraColetor, ]); @@ -199,7 +199,7 @@ export default app => { * $ref: '#/components/responses/InternalServerError' */ app.route('/coletores').get([ - tokensMiddleware(['CURADOR']), + tokensMiddleware([TIPOS_USUARIOS.CURADOR]), validacoesMiddleware(listarColetoresEsquema), listagensMiddleware, coletoresController.listaColetores, @@ -267,7 +267,7 @@ export default app => { * $ref: '#/components/responses/InternalServerError' */ app.route('/coletores/:id').put([ - tokensMiddleware(['CURADOR']), + tokensMiddleware([TIPOS_USUARIOS.CURADOR]), validacoesMiddleware(atualizarColetorEsquema), coletoresController.atualizaColetor, ]); @@ -299,7 +299,7 @@ export default app => { * $ref: '#/components/responses/InternalServerError' */ app.route('/coletores/:id').delete([ - tokensMiddleware(['CURADOR']), + tokensMiddleware([TIPOS_USUARIOS.CURADOR]), validacoesMiddleware(desativarColetorEsquema), coletoresController.desativaColetor, ]);