Skip to content

Commit

Permalink
add husky and security updates
Browse files Browse the repository at this point in the history
  • Loading branch information
rrfaria committed Aug 28, 2019
1 parent cc5f2e0 commit bdfd07b
Show file tree
Hide file tree
Showing 15 changed files with 952 additions and 760 deletions.
12 changes: 8 additions & 4 deletions controllers/books.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,25 @@ export default class BooksController {

create(data) {
return this.Books.create(data)
.then(result => defaultResponse(result, HttpStatus.CREATED)) // 201 um recurso foi criado
.catch(error => errorResponse(error.message, HttpStatus.UNPROCESSABLE_ENTITY)); // 402 entidade nao pode ser processada
// 201 um recurso foi criado
.then(result => defaultResponse(result, HttpStatus.CREATED))
// 402 entidade nao pode ser processada
.catch(error => errorResponse(error.message, HttpStatus.UNPROCESSABLE_ENTITY));
}

update(data, params) {
return this.Books.update(data, {
where: params,
}).then(result => defaultResponse(result))
.catch(error => errorResponse(error.message, HttpStatus.UNPROCESSABLE_ENTITY)); // 402 entidade nao pode ser processada
// 402 entidade nao pode ser processada
.catch(error => errorResponse(error.message, HttpStatus.UNPROCESSABLE_ENTITY));
}

delete(params) {
return this.Books.destroy({
where: params,
}).then(result => defaultResponse(result, HttpStatus.NO_CONTENT))
.catch(error => errorResponse(error.message, HttpStatus.UNPROCESSABLE_ENTITY)); // 402 entidade nao pode ser processada
// 402 entidade nao pode ser processada
.catch(error => errorResponse(error.message, HttpStatus.UNPROCESSABLE_ENTITY));
}
}
12 changes: 8 additions & 4 deletions controllers/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,25 @@ export default class UsersController {

create(data) {
return this.Users.create(data)
.then(result => defaultResponse(result, HttpStatus.CREATED)) // 201 um recurso foi criado
.catch(error => errorResponse(error.message, HttpStatus.UNPROCESSABLE_ENTITY)); // 402 entidade nao pode ser processada
// 201 um recurso foi criado
.then(result => defaultResponse(result, HttpStatus.CREATED))
// 402 entidade nao pode ser processada
.catch(error => errorResponse(error.message, HttpStatus.UNPROCESSABLE_ENTITY));
}

update(data, params) {
return this.Users.update(data, {
where: params,
}).then(result => defaultResponse(result))
.catch(error => errorResponse(error.message, HttpStatus.UNPROCESSABLE_ENTITY)); // 402 entidade nao pode ser processada
// 402 entidade nao pode ser processada
.catch(error => errorResponse(error.message, HttpStatus.UNPROCESSABLE_ENTITY));
}

delete(params) {
return this.Users.destroy({
where: params,
}).then(result => defaultResponse(result, HttpStatus.NO_CONTENT))
.catch(error => errorResponse(error.message, HttpStatus.UNPROCESSABLE_ENTITY)); // 402 entidade nao pode ser processada
// 402 entidade nao pode ser processada
.catch(error => errorResponse(error.message, HttpStatus.UNPROCESSABLE_ENTITY));
}
}
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import app from './app';

app.listen(app.get('port'), () => {
console.log(`app rodando na porta:${app.get('port')}`);
// eslint-disable-next-line no-console
console.log(`app rodando na porta:${app.get('port')}`);
});
Loading

0 comments on commit bdfd07b

Please sign in to comment.