Profile page uses new movies-list parameters and seasonedApi updated to handle authentication tokens. TODO move away auth token from getLists function

This commit is contained in:
2019-06-04 21:46:03 +02:00
parent ca1cb029bc
commit 1b6a494cc0
2 changed files with 6 additions and 5 deletions

View File

@@ -12,10 +12,8 @@
</header> </header>
<settings v-if="showSettings"></settings> <settings v-if="showSettings"></settings>
<!-- <movies-list v-for="item in listTypes" v-if="!showSettings && item.isProfileContent" :type="'component'" :mode="item.type" :category="item.query" :shortList="true"></movies-list> --> <movies-list :propList="user_requestsList"></movies-list>
<!-- <movies-list v-for="item in listTypes" v-if="item.isCategory" :type="'component'" :mode="item.type" :shortList="true"></movies-list> -->
<!-- <created-lists></created-lists> -->
</div> </div>
<section class="not-found" v-if="!userLoggedIn"> <section class="not-found" v-if="!userLoggedIn">
@@ -46,7 +44,7 @@ export default {
userName: '', userName: '',
emoji: '', emoji: '',
showSettings: false, showSettings: false,
listTypes: storage.listTypes user_requestsList: storage.user_requestsList
} }
}, },
methods: { methods: {

View File

@@ -1,4 +1,5 @@
import axios from 'axios' import axios from 'axios'
import storage from '@/storage.js'
// const BASE_URL = 'https://api.kevinmidboe.com/api/' // const BASE_URL = 'https://api.kevinmidboe.com/api/'
const BASE_URL = 'http://localhost:31459/api/' const BASE_URL = 'http://localhost:31459/api/'
@@ -29,7 +30,9 @@ const getShow = (id, credits) => {
const getListByName = (listPath, page) => { const getListByName = (listPath, page) => {
const url = `${BASE_URL}${listPath}?page=${page}` const url = `${BASE_URL}${listPath}?page=${page}`
return axios.get(url) // TODO - remove. this is temporary fix for user-requests endpoint (also import)
const headers = { authorization: storage.token }
return axios.get(url, { headers: headers })
.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 })
} }