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

fix value check when saving property

parent fde3cc26
...@@ -181,7 +181,7 @@ export default { ...@@ -181,7 +181,7 @@ export default {
}, },
saveProperty (property, value, modal, event) { saveProperty (property, value, modal, event) {
if (this.string !== this.selectedShow.email) { if (value !== this.selectedShow[property]) {
event.preventDefault() event.preventDefault()
this.$store.dispatch('shows/updateProperty', { this.$store.dispatch('shows/updateProperty', {
id: this.selectedShow.id, id: this.selectedShow.id,
...@@ -195,21 +195,15 @@ export default { ...@@ -195,21 +195,15 @@ export default {
}, },
saveName (event) { saveName (event) {
if (this.string !== this.selectedShow.name) { this.saveProperty('name', this.string, this.$refs.modalName, event)
this.saveProperty('name', this.string, this.$refs.modalName, event)
}
}, },
saveShortDescription (event) { saveShortDescription (event) {
if (this.string !== this.selectedShow.short_description) { this.saveProperty('short_description', this.string, this.$refs.modalShortDescription, event)
this.saveProperty('short_description', this.string, this.$refs.modalShortDescription, event)
}
}, },
saveDescription (event) { saveDescription (event) {
if (this.string !== this.selectedShow.description) { this.saveProperty('description', this.string, this.$refs.modalDescription, event)
this.saveProperty('description', this.string, this.$refs.modalDescription, event)
}
}, },
deactivateShow (event) { deactivateShow (event) {
......
...@@ -347,7 +347,7 @@ export default { ...@@ -347,7 +347,7 @@ export default {
}, },
saveProperty (property, value, modal, event) { saveProperty (property, value, modal, event) {
if (this.string !== this.selectedShow.email) { if (value !== this.selectedShow[property]) {
event.preventDefault() event.preventDefault()
this.$store.dispatch('shows/updateProperty', { this.$store.dispatch('shows/updateProperty', {
id: this.selectedShow.id, id: this.selectedShow.id,
...@@ -361,41 +361,29 @@ export default { ...@@ -361,41 +361,29 @@ export default {
}, },
saveEmail (event) { saveEmail (event) {
if (this.string !== this.selectedShow.email) { this.saveProperty('email', this.string, this.$refs.modalEmail, event)
this.saveProperty('email', this.string, this.$refs.modalEmail, event)
}
}, },
saveWebsite (event) { saveWebsite (event) {
if (this.string !== this.selectedShow.website) { this.saveProperty('website', this.string, this.$refs.modalWebsite, event)
this.saveProperty('website', this.string, this.$refs.modalWebsite, event)
}
}, },
saveCBAid (event) { saveCBAid (event) {
if (this.id !== this.selectedShow.cba_series_id) { let id = this.id === '' ? null : this.id
let id = this.id === '' ? null : this.id this.saveProperty('cba_series_id', id, this.$refs.modalCBAid, event)
this.saveProperty('cba_series_id', id, this.$refs.modalCBAid, event)
}
}, },
savePredecessor (event) { savePredecessor (event) {
if (this.id !== this.selectedShow.predecessor) { let id = this.id === '' ? null : this.id
let id = this.id === '' ? null : this.id this.saveProperty('predecessor', id, this.$refs.modalPredecessor, event)
this.saveProperty('predecessor', id, this.$refs.modalPredecessor, event)
}
}, },
saveFundingCategory (event) { saveFundingCategory (event) {
if (this.id !== this.selectedShow.fundingcategory) { this.saveProperty('fundingcategory', this.id, this.$refs.modalFundingCategory, event)
this.saveProperty('fundingcategory', this.id, this.$refs.modalFundingCategory, event)
}
}, },
saveShowType (event) { saveShowType (event) {
if (this.id !== this.selectedShow.type) { this.saveProperty('type', this.id, this.$refs.modalType, event)
this.saveProperty('type', this.id, this.$refs.modalType, event)
}
}, },
// Just a placeholder function we can use in the UI, to signal if something // Just a placeholder function we can use in the UI, to signal if something
......
Markdown is supported
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