Indentation
This commit is contained in:
@@ -88,16 +88,16 @@ class RequestRepository {
|
|||||||
*/
|
*/
|
||||||
requestFromTmdb(tmdb, ip, user_agent, username) {
|
requestFromTmdb(tmdb, ip, user_agent, username) {
|
||||||
return Promise.resolve()
|
return Promise.resolve()
|
||||||
.then(() => this.database.get(this.queries.read, [tmdb.id, tmdb.type]))
|
.then(() => this.database.get(this.queries.read, [tmdb.id, tmdb.type]))
|
||||||
.then(row => assert.equal(row, undefined, 'Id has already been requested'))
|
.then(row => assert.equal(row, undefined, 'Id has already been requested'))
|
||||||
.then(() => this.database.run(this.queries.add, [tmdb.id, tmdb.title, tmdb.year, tmdb.poster, tmdb.backdrop, username, ip, user_agent, tmdb.type]))
|
.then(() => this.database.run(this.queries.add, [tmdb.id, tmdb.title, tmdb.year, tmdb.poster, tmdb.backdrop, username, ip, user_agent, tmdb.type]))
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
if (error.name === 'AssertionError' || error.message.endsWith('been requested')) {
|
if (error.name === 'AssertionError' || error.message.endsWith('been requested')) {
|
||||||
throw new Error('This id is already requested', error.message);
|
throw new Error('This id is already requested', error.message);
|
||||||
}
|
}
|
||||||
console.log('Error @ request.addTmdb:', error);
|
console.log('Error @ request.addTmdb:', error);
|
||||||
throw new Error('Could not add request');
|
throw new Error('Could not add request');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user