Refactored ⛏

This commit is contained in:
2019-06-28 21:26:51 +02:00
parent 651f7429cf
commit 8e58ba49ce

View File

@@ -147,7 +147,7 @@ export default {
userLoggedIn: storage.sessionId ? true : false, userLoggedIn: storage.sessionId ? true : false,
requested: false, requested: false,
admin: localStorage.getItem('admin'), admin: localStorage.getItem('admin'),
showTorrents: false, showTorrents: false
} }
}, },
methods: { methods: {
@@ -161,7 +161,7 @@ export default {
this.checkIfRequested(movie) this.checkIfRequested(movie)
.then(status => this.requested = status) .then(status => this.requested = status)
document.title = movie.title + storage.pageTitlePostfix; document.title = movie.title + storage.pageTitlePostfix
}, },
async checkIfRequested(movie) { async checkIfRequested(movie) {
return await getRequestStatus(movie.id, movie.type) return await getRequestStatus(movie.id, movie.type)
@@ -174,8 +174,9 @@ export default {
sendRequest(){ sendRequest(){
request(this.id, this.type, storage.token) request(this.id, this.type, storage.token)
.then(resp => { .then(resp => {
if (resp.data.success) if (resp.data.success) {
this.requested = true this.requested = true
}
}) })
}, },
openTmdb(){ openTmdb(){