Skip to content

Commit a5ee235

Browse files
committed
fixup! fix: save don't update route when nothing changed
1 parent b5c9160 commit a5ee235

File tree

1 file changed

+9
-6
lines changed
  • src/fragments/forms/map-form/components/optimization/components/edit-dialog

1 file changed

+9
-6
lines changed

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,13 @@ export default {
139139
}
140140
return jsonSkills
141141
},
142+
editDataJson () {
143+
const jsonData = []
144+
for (const data of this.editData) {
145+
jsonData.push(data.toJSON())
146+
}
147+
return jsonData
148+
},
142149
},
143150
created () {
144151
if (this.editProp === 'jobs') {
@@ -158,8 +165,7 @@ export default {
158165
this.editId = this.index
159166
}
160167
//create a string of data as copy
161-
this.dataCopy = JSON.stringify(this.editData)
162-
this.skillsCopy = JSON.stringify(this.editSkills)
168+
this.dataCopy = JSON.stringify(this.editDataJson)
163169

164170
// close editJobs box to pick a place from the map
165171
EventBus.$on('pickAPlace', () => {
@@ -240,13 +246,10 @@ export default {
240246
if (this.content.item === 'Vehicle') {
241247
this.validateTimeWindow()
242248
}
243-
/* if(JSON.stringify(this.editSkills) !== this.skillsCopy){
244-
TODO: update skills
245-
}*/
246249
if (this.hasEmptyLocation) {
247250
this.showError(this.content.emptyLoc, {timeout: 3000})
248251
} else {
249-
if(JSON.stringify(this.editData) !== this.dataCopy){
252+
if(JSON.stringify(this.editDataJson) !== this.dataCopy){
250253
this.$emit(this.content.changedEvent, this.editData)
251254
}
252255
this.closeEditModal()

0 commit comments

Comments
 (0)