Skip to content
This repository was archived by the owner on Jan 20, 2020. It is now read-only.

Commit 866f0a0

Browse files
author
Luciano Nooijen
committed
Remove data checks in db methods
1 parent ee8098f commit 866f0a0

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

controllers/authors.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ const addAuthor = async author => {
2727
};
2828

2929
const modifyAuthor = async (id, author) => {
30-
if (typeof id !== 'number') {
31-
throw new Error('ID must be numner');
32-
}
3330
// eslint-disable-next-line camelcase
3431
const { name, image_url, role } = author;
3532
const newAuthorData = { name, image_url, role };
@@ -44,9 +41,6 @@ const modifyAuthor = async (id, author) => {
4441
};
4542

4643
const deleteAuthor = async id => {
47-
if (typeof id !== 'number') {
48-
throw new Error('ID must be numner');
49-
}
5044
return new Promise(resolve => {
5145
knex('users')
5246
.where({ author_id: id })

0 commit comments

Comments
 (0)