Added type input to the sendRequest function.

This commit is contained in:
2017-09-03 18:16:26 +02:00
parent 2b7f9551bf
commit 9eb31ea433
2 changed files with 10 additions and 5 deletions

View File

@@ -67,13 +67,16 @@ class RequestRepository {
});
}
sendRequest(identifier) {
/**
* Send request for given media id.
* @param {identifier, type} the id of the media object and type of media must be defined
* @returns {Promise} If nothing has gone wrong.
*/
sendRequest(identifier, type) {
// TODO add to DB so can have a admin page
// TODO try a cache hit on the movie item
tmdb.lookup(identifier).then(movie => {
console.log(movie.title)
tmdb.lookup(identifier, type).then(movie => {
// create reusable transporter object using the default SMTP transport
let transporter = nodemailer.createTransport({
@@ -110,6 +113,7 @@ class RequestRepository {
})
// TODO add better response when done.
return Promise.resolve();
}