Commit 8be528a4 authored by jackie / Andrea Ida Malkah Klaura's avatar jackie / Andrea Ida Malkah Klaura
Browse files

Merge branch 'develop' of gitlab.servus.at:autoradio/dashboard into develop

parents 1f4c5bf5 3888ff92
...@@ -131,9 +131,9 @@ ...@@ -131,9 +131,9 @@
<b-col lg="6"> <b-col lg="6">
<p> <p>
<!-- TODO: discuss: should this be visible to show owners or only to administrators? --> <!-- TODO: discuss: should this be visible to show owners or only to administrators? -->
<!-- TODO: fetch name for predecessor_id from steering api --> <!-- TODO: fetch name for predecessor from steering api -->
<b-badge variant="light">Predecessor:</b-badge> <b-badge variant="light">Predecessor:</b-badge>
<span v-if="shows[currentShow].predecessor_id === null"><small><i>This show has no predecessor show.</i></small></span> <span v-if="shows[currentShow].predecessor === null"><small><i>This show has no predecessor show.</i></small></span>
<span v-else>{{ predecessorName }}</span> <span v-else>{{ predecessorName }}</span>
<img src="../assets/16x16/emblem-system.png" alt="edit" v-on:click="$refs.appModalShow.showPredecessor()" /> <img src="../assets/16x16/emblem-system.png" alt="edit" v-on:click="$refs.appModalShow.showPredecessor()" />
</p> </p>
...@@ -309,7 +309,7 @@ export default { ...@@ -309,7 +309,7 @@ export default {
computed: { computed: {
predecessorName: function () { predecessorName: function () {
for (var i in this.shows) { for (var i in this.shows) {
if (this.shows[i].id === this.shows[this.currentShow].predecessor_id) { if (this.shows[i].id === this.shows[this.currentShow].predecessor) {
return this.shows[i].name return this.shows[i].name
} }
} }
......
...@@ -396,21 +396,25 @@ export default { ...@@ -396,21 +396,25 @@ export default {
} }
}, },
savePredecessor (event) { savePredecessor (event) {
if (this.id !== this.show.predecessor_id) { if (this.id !== this.show.predecessor) {
event.preventDefault() event.preventDefault()
<<<<<<< HEAD
this.backupid = this.show.predecessor_id this.backupid = this.show.predecessor_id
this.show.predecessor_id = this.id this.show.predecessor_id = this.id
console.log(this.show.predecessor_id) console.log(this.show.predecessor_id)
axios.put(process.env.VUE_APP_API_STEERING_SHOWS + this.show.id + '/', this.show, { axios.put(process.env.VUE_APP_API_STEERING_SHOWS + this.show.id + '/', this.show, {
=======
this.backupid = this.show.predecessor
this.show.predecessor = this.id
console.log(this.show.predecessor)
axios.put(process.env.API_STEERING_SHOWS + this.show.id + '/', this.show, {
>>>>>>> 3888ff92fbc548600ff336cd605a9e1087a603d9
withCredentials: true, withCredentials: true,
headers: { 'Authorization': 'Bearer ' + this.$parent.$parent.user.access_token } headers: { 'Authorization': 'Bearer ' + this.$parent.$parent.user.access_token }
}).then(response => { }).then(response => {
// this.$parent.shows[this.$parent.currentShow].predecessor_id = this.show.predecessor_id
console.log('saved ' + this.show.predecessor_id)
console.log(response)
this.$refs.modalShowPredecessor.hide() this.$refs.modalShowPredecessor.hide()
}).catch(error => { }).catch(error => {
this.show.predecessor_id = this.backupid this.show.predecessor = this.backupid
console.log('Error:') console.log('Error:')
console.log(error) console.log(error)
alert('Error: could not save the new show information') alert('Error: could not save the new show information')
...@@ -555,7 +559,7 @@ export default { ...@@ -555,7 +559,7 @@ export default {
this.$refs.modalShowCBAid.show() this.$refs.modalShowCBAid.show()
}, },
showPredecessor () { showPredecessor () {
this.id = this.show.predecessor_id this.id = this.show.predecessor
this.$refs.modalShowPredecessor.show() this.$refs.modalShowPredecessor.show()
}, },
showType () { showType () {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment