Extended function names to clearify its action
This commit is contained in:
@@ -29,7 +29,7 @@ const getShow = (id, credits) => {
|
|||||||
.catch(error => { console.error(`api error getting show: ${id}`); throw error })
|
.catch(error => { console.error(`api error getting show: ${id}`); throw error })
|
||||||
}
|
}
|
||||||
|
|
||||||
const getListByName = (listPath, page) => {
|
const getTmdbListByPath = (listPath, page) => {
|
||||||
const url = `${SEASONED_URL}${listPath}?page=${page}`
|
const url = `${SEASONED_URL}${listPath}?page=${page}`
|
||||||
// TODO - remove. this is temporary fix for user-requests endpoint (also import)
|
// TODO - remove. this is temporary fix for user-requests endpoint (also import)
|
||||||
const headers = { authorization: storage.token }
|
const headers = { authorization: storage.token }
|
||||||
@@ -37,7 +37,7 @@ const getListByName = (listPath, page) => {
|
|||||||
.catch(error => { console.error(`api error getting list: ${listPath}, page: ${page}`); throw error })
|
.catch(error => { console.error(`api error getting list: ${listPath}, page: ${page}`); throw error })
|
||||||
}
|
}
|
||||||
|
|
||||||
const search = (query, page) => {
|
const searchTmdb = (query, page) => {
|
||||||
const url = `${SEASONED_URL}v2/search?query=${query}&page=${page}`
|
const url = `${SEASONED_URL}v2/search?query=${query}&page=${page}`
|
||||||
return axios.get(url)
|
return axios.get(url)
|
||||||
.catch(error => { console.error(`api error searching: ${query}, page: ${page}`); throw error })
|
.catch(error => { console.error(`api error searching: ${query}, page: ${page}`); throw error })
|
||||||
@@ -140,4 +140,4 @@ const elasticSearchMoviesAndShows = (query) => {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
export { getMovie, getShow, getListByName, search, searchTorrents, addMagnet, request, plexAuthenticate, getEmoji, elasticSearchMoviesAndShows }
|
export { getMovie, getShow, getTmdbListByPath, searchTmdb, searchTorrents, addMagnet, request, plexAuthenticate, getEmoji, elasticSearchMoviesAndShows }
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ import MoviesListItem from '@/components/MoviesListItem.vue'
|
|||||||
import SeasonedButton from '@/components/ui/SeasonedButton.vue'
|
import SeasonedButton from '@/components/ui/SeasonedButton.vue'
|
||||||
import LoadingPlaceholder from '@/components/ui/LoadingPlaceholder.vue'
|
import LoadingPlaceholder from '@/components/ui/LoadingPlaceholder.vue'
|
||||||
import Loader from '@/components/ui/Loader.vue'
|
import Loader from '@/components/ui/Loader.vue'
|
||||||
import { search, getListByName } from '@/api.js'
|
import { searchTmdb, getTmdbListByPath } from '@/api.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
@@ -136,7 +136,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// TODO these should receive a path not get it from list instance
|
// TODO these should receive a path not get it from list instance
|
||||||
fetchListitems() {
|
fetchListitems() {
|
||||||
getListByName(this.list.path, this.currentPage)
|
getTmdbListByPath(this.list.path, this.currentPage)
|
||||||
.then(this.parseResponse)
|
.then(this.parseResponse)
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
@@ -144,7 +144,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
fetchSearchItems() {
|
fetchSearchItems() {
|
||||||
search(this.query, this.currentPage)
|
searchTmdb(this.query, this.currentPage)
|
||||||
.then(this.parseResponse)
|
.then(this.parseResponse)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user