Skip to content

Commit

Permalink
fix: save don't update route when nothing changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Seli0303 committed Aug 6, 2024
1 parent 39bb727 commit 91c48fe
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ export default {
isEditOpen: true,
editId: 0,
editData: [],
dataCopy: '',
editSkills: [],
skillsCopy: '',
jobsBox: false,
vehiclesBox: false,
pickPlaceSupported: true,
Expand Down Expand Up @@ -155,6 +157,9 @@ export default {
if (this.index > 0) {
this.editId = this.index
}
//create a string of data as copy
this.dataCopy = JSON.stringify(this.editData)
this.skillsCopy = JSON.stringify(this.editSkills)

// close editJobs box to pick a place from the map
EventBus.$on('pickAPlace', () => {
Expand Down Expand Up @@ -235,10 +240,15 @@ export default {
if (this.content.item === 'Vehicle') {
this.validateTimeWindow()
}
/* if(JSON.stringify(this.editSkills) !== this.skillsCopy){
TODO: update skills
}*/
if (this.hasEmptyLocation) {
this.showError(this.content.emptyLoc, {timeout: 3000})
} else {
this.$emit(this.content.changedEvent, this.editData)
if(JSON.stringify(this.editData) !== this.dataCopy){
this.$emit(this.content.changedEvent, this.editData)
}
this.closeEditModal()
}
},
Expand Down

0 comments on commit 91c48fe

Please sign in to comment.