Removed manual axios call for emojis. Now use the seasonedApi controller function getEmoji

This commit is contained in:
2019-06-04 20:10:24 +02:00
parent 6239b93a75
commit a306664bd7

View File

@@ -30,10 +30,12 @@
</template> </template>
<script> <script>
import axios from 'axios'
import storage from '../storage.js' import storage from '../storage.js'
import MoviesList from './MoviesList.vue' import MoviesList from './MoviesList.vue'
import Settings from './Settings.vue' import Settings from './Settings.vue'
import SeasonedButton from '@/components/ui/SeasonedButton.vue'
import { getEmoji } from '@/seasonedAPI.js'
// import CreatedLists from './CreatedLists.vue' // import CreatedLists from './CreatedLists.vue'
export default { export default {
@@ -61,18 +63,9 @@ export default {
} }
}.bind(this)); }.bind(this));
}, },
getNewEmoji(){
axios.get(`https://api.kevinmidboe.com/api/v1/emoji`)
.then(function(resp){
this.emoji = resp.data.emoji;
}.bind(this))
},
getUserInfo(){ getUserInfo(){
this.userName = localStorage.getItem('username'); this.userName = localStorage.getItem('username');
}, },
requestToken(){
eventHub.$emit('requestToken');
},
toggleSettings() { toggleSettings() {
this.showSettings = this.showSettings ? false : true; this.showSettings = this.showSettings ? false : true;
}, },
@@ -90,7 +83,9 @@ export default {
} else { } else {
this.userLoggedIn = true; this.userLoggedIn = true;
this.getUserInfo(); this.getUserInfo();
this.getNewEmoji();
getEmoji()
.then(resp => this.emoji = resp.data.emoji )
} }
} }
} }