Now can handle type selector aswell
This commit is contained in:
@@ -6,10 +6,10 @@ class TMDB {
|
|||||||
this.tmdbLibrary = tmdbLibrary || moviedb(apiKey);
|
this.tmdbLibrary = tmdbLibrary || moviedb(apiKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
search(text, page = 1) {
|
search(text, page = 1, type = 'searchMulti') {
|
||||||
const query = { query: text, page };
|
const query = { query: text, page };
|
||||||
return Promise.resolve()
|
return Promise.resolve()
|
||||||
.then(() => this.tmdb('searchMulti', query))
|
.then(() => this.tmdb(type, query))
|
||||||
.catch(() => { throw new Error('Could not search for movies.'); })
|
.catch(() => { throw new Error('Could not search for movies.'); })
|
||||||
.then((reponse) => {
|
.then((reponse) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user