Skip to content

Commit

Permalink
Lint files
Browse files Browse the repository at this point in the history
  • Loading branch information
rgaiacs committed Jul 23, 2020
1 parent 5daca0e commit 59aed66
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 32 deletions.
8 changes: 4 additions & 4 deletions src/__tests__/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ describe(
id_lesao: expect.any(Number),
id_usuario: expect.any(Number),
coord_centro_nucleo_x: expect.any(Number),
coord_centro_nucleo_y: expect.any(Number),
coord_centro_nucleo_y: expect.any(Number)
// lesao: {
// detalhes: expect.any(String),
// id: expect.any(Number),
Expand Down Expand Up @@ -891,7 +891,7 @@ describe(
id_lesao:expect.any(Number),
id_usuario: expect.any(Number),
coord_centro_nucleo_x: expect.any(Number),
coord_centro_nucleo_y: expect.any(Number),
coord_centro_nucleo_y: expect.any(Number)
// lesao: {
// detalhes: expect.any(String),
// id: expect.any(Number),
Expand Down Expand Up @@ -950,7 +950,7 @@ describe(
id_lesao:expect.any(Number),
id_usuario: expect.any(Number),
coord_centro_nucleo_x: expect.any(Number),
coord_centro_nucleo_y: expect.any(Number),
coord_centro_nucleo_y: expect.any(Number)
// lesao: {
// detalhes: expect.any(String),
// id: expect.any(Number),
Expand Down Expand Up @@ -988,7 +988,7 @@ describe(
id_lesao:expect.any(Number),
id_usuario: expect.any(Number),
coord_centro_nucleo_x: expect.any(Number),
coord_centro_nucleo_y: expect.any(Number),
coord_centro_nucleo_y: expect.any(Number)
// lesao: {
// detalhes: expect.any(String),
// id: expect.any(Number),
Expand Down
1 change: 0 additions & 1 deletion src/controllers/imagem_controller/ImagemController.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ module.exports = {

async cadastrarLesoes(req, res) {

let lesoesCadastradas;
try {
await CadastrarLesaoExecutor.Executar(req);
return res.status(HttpStatus.CREATED).end();
Expand Down
2 changes: 0 additions & 2 deletions src/controllers/sistema/SistemaController.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ module.exports = {
if(erro.status) {
return res.status(erro.status).json(erro);
}

debug(erro);
return res.status(HttpStatus.INTERNAL_SERVER_ERROR).json(erro);
}
},
Expand Down
13 changes: 6 additions & 7 deletions src/executores/imagem_executor/CadastrarLesaoExecutor.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
// eslint-disable-next-line no-unused-vars
const debug = require("debug")("database.cric:CadastrarLesaoExecutor");

const HttpStatus = require("http-status-codes");

const ImagemRepositorio = require("../../repositorios/imagem_repositorio");

const Excecao = require("../../utils/enumeracoes/mensagem_excecoes");
const ObjetoExcecao = require("../../utils/enumeracoes/controle_de_excecoes");
const HttpStatus = require("http-status-codes");
const ValidarTipo = require("../../utils/validacao_de_tipos");
const ValidadorDeSessao = require("../../utils/validador_de_sessao");
const ListarLesoes = require("../imagem_executor/ListarLesoesExecutor");
const ImagemRepositorio = require("../../repositorios/imagem_repositorio");
const UsuarioRepositorio = require("../../repositorios/usuario_repositorio");

module.exports = {

Expand All @@ -26,14 +25,14 @@ async function validarRequisicao(req) {
if(!req.body.nome) {
ObjetoExcecao.status = HttpStatus.BAD_REQUEST;
ObjetoExcecao.title = Excecao.PARAMETROS_INVALIDOS;
ObjetoExcecao.detail = `Missing nome`;
ObjetoExcecao.detail = "Missing nome";
throw ObjetoExcecao;
}

if(!req.body.grade) {
ObjetoExcecao.status = HttpStatus.BAD_REQUEST;
ObjetoExcecao.title = Excecao.PARAMETROS_INVALIDOS;
ObjetoExcecao.detail = `Missing grade`;
ObjetoExcecao.detail = "Missing grade";
throw ObjetoExcecao;
}
}
5 changes: 0 additions & 5 deletions src/executores/usuario_executor/ListarUsuariosExecutor.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
"use strict";

const HttpStatus = require("http-status-codes");

const Excecao = require("../../utils/enumeracoes/mensagem_excecoes");
const ObjetoExcecao = require("../../utils/enumeracoes/controle_de_excecoes");
const ValidadorDeSessao = require("../../utils/validador_de_sessao");
const ValidarTipo = require("../../utils/validacao_de_tipos");

const UsuarioRepositorio = require("../../repositorios/usuario_repositorio");

Expand Down
5 changes: 1 addition & 4 deletions src/executores/usuario_executor/ObterUsuarioExecutor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ const debug = require("debug")("database.cric:ObterUsuarioExecutor");
const HttpStatus = require("http-status-codes");

const UsuarioRepositorio = require("../../repositorios/usuario_repositorio");
const SessaoRepositorio = require("../../repositorios/sessao_repositorio");

const Criptografia = require("../../utils/criptografia");
const Excecao = require("../../utils/enumeracoes/mensagem_excecoes");
const GeradorIdUnico = require("../../utils/gerador_identificador_unico");
const ObjetoExcecao = require("../../utils/enumeracoes/controle_de_excecoes");
const ValidadorDeSessao = require("../../utils/validador_de_sessao");
const ValidarTipo = require("../../utils/validacao_de_tipos");
Expand Down Expand Up @@ -49,4 +46,4 @@ async function validarRequisicao(req) {
ObjetoExcecao.title = Excecao.PARAMETROS_INVALIDOS;
throw ObjetoExcecao;
}
};
}
10 changes: 5 additions & 5 deletions src/migrations/20200717210518-remove-caminho_imagem.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
'use strict';
"use strict";

module.exports = {
up: (queryInterface, Sequelize) => {
up: (queryInterface) => {
return queryInterface.removeColumn(
"imagem",
"caminho_imagem",
{}
);
},
},

down: (queryInterface, Sequelize) => {
down: (queryInterface, Sequelize) => {
return queryInterface.addColumn(
"imagem",
"caminho_imagem",
Sequelize.INTEGER,
{}
);
}
}
};
8 changes: 4 additions & 4 deletions src/migrations/20200722171203-bool.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';
"use strict";

module.exports = {
up: (queryInterface, Sequelize) => {
Expand All @@ -16,10 +16,10 @@ module.exports = {
)
]
);
},
},

down: (queryInterface, Sequelize) => {
return Promise.all(
return Promise.all(
[
queryInterface.changeColumn(
"imagem",
Expand All @@ -33,5 +33,5 @@ module.exports = {
)
]
);
}
}
};

0 comments on commit 59aed66

Please sign in to comment.