Skip to content

Commit b5c9160

Browse files
committed
fix: save don't update route when nothing changed
1 parent 93fffc9 commit b5c9160

File tree

1 file changed

+11
-1
lines changed
  • src/fragments/forms/map-form/components/optimization/components/edit-dialog

1 file changed

+11
-1
lines changed

src/fragments/forms/map-form/components/optimization/components/edit-dialog/edit-dialog.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ export default {
2020
isEditOpen: true,
2121
editId: 0,
2222
editData: [],
23+
dataCopy: '',
2324
editSkills: [],
25+
skillsCopy: '',
2426
jobsBox: false,
2527
vehiclesBox: false,
2628
pickPlaceSupported: true,
@@ -155,6 +157,9 @@ export default {
155157
if (this.index > 0) {
156158
this.editId = this.index
157159
}
160+
//create a string of data as copy
161+
this.dataCopy = JSON.stringify(this.editData)
162+
this.skillsCopy = JSON.stringify(this.editSkills)
158163

159164
// close editJobs box to pick a place from the map
160165
EventBus.$on('pickAPlace', () => {
@@ -235,10 +240,15 @@ export default {
235240
if (this.content.item === 'Vehicle') {
236241
this.validateTimeWindow()
237242
}
243+
/* if(JSON.stringify(this.editSkills) !== this.skillsCopy){
244+
TODO: update skills
245+
}*/
238246
if (this.hasEmptyLocation) {
239247
this.showError(this.content.emptyLoc, {timeout: 3000})
240248
} else {
241-
this.$emit(this.content.changedEvent, this.editData)
249+
if(JSON.stringify(this.editData) !== this.dataCopy){
250+
this.$emit(this.content.changedEvent, this.editData)
251+
}
242252
this.closeEditModal()
243253
}
244254
},

0 commit comments

Comments
 (0)