Skip to content

Commit

Permalink
fix(Price add): send price location_id to fix server error. ref #965
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Oct 22, 2024
1 parent c09e053 commit d9850b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
9 changes: 0 additions & 9 deletions src/components/LocationInputRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,9 @@ export default {
default: 3
}
},
emits: ['location'],
data() {
return {
locationSelectorDialog: false,
locationObject: null,
loading: false,
}
},
Expand All @@ -73,11 +71,6 @@ export default {
return Object.keys(this.locationForm).filter(k => keys.includes(k)).every(k => !!this.locationForm[k])
},
},
watch: {
locationObject(newLocationObject, oldLocationObject) { // eslint-disable-line no-unused-vars
this.$emit('location', newLocationObject)
}
},
mounted() {
this.initLocationForm()
},
Expand All @@ -101,8 +94,6 @@ export default {
// update locationForm
this.locationForm.location_osm_id = utils.getLocationID(location)
this.locationForm.location_osm_type = utils.getLocationType(location)
// set locationObject
this.locationObject = location
},
isSelectedLocation(location) {
return utils.buildLocationUniqueId(this.locationForm.location_osm_id, this.locationForm.location_osm_type) === utils.getLocationUniqueID(location)
Expand Down
6 changes: 3 additions & 3 deletions src/components/ProofInputRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<v-col v-if="!proofObject" cols="12">
<ProofTypeInputRow :proofTypeForm="proofForm" />
<ProofImageInputRow :proofImageForm="proofForm" :hideRecentProofChoice="hideRecentProofChoice" @proof="proofImage = $event" />
<LocationInputRow :locationForm="proofForm" @location="locationObject = $event" />
<LocationInputRow :locationForm="proofForm" />
<ProofMetadataInputRow :proofType="proofForm.type" :proofMetadataForm="proofForm" />
<v-row>
<v-col>
Expand Down Expand Up @@ -93,7 +93,6 @@ export default {
proofSelectedSuccessMessage: false,
proofSuccessMessage: false,
proofImage: null,
locationObject: null,
proofObject: null,
loading: false,
}
Expand Down Expand Up @@ -173,7 +172,8 @@ export default {
this.loading = false
if (data.id) {
this.proofForm.proof_id = data.id
this.proofObject = {...data, ...{location: this.locationObject}}
this.proofForm.location_id = data.location_id
this.proofObject = data
this.proofSuccessMessage = true
} else {
alert('Error: server error when creating proof')
Expand Down

0 comments on commit d9850b7

Please sign in to comment.