Skip to content

Commit

Permalink
Fix #1645
Browse files Browse the repository at this point in the history
  • Loading branch information
jlpereira committed Aug 11, 2020
1 parent 373254c commit 6b10807
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<input
v-model="collectingEvent.units"
type="radio"
value="m"
:value="undefined"
name="elevation">
Meters
</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@ export default function ({ commit, state }) {
let collection_event = state.collection_event
let identifier = state.collectingEventIdentifier
commit(MutationNames.SetCollectionEventIdentifier, identifierCE())
if(identifier.namespace_id && identifier.identifier) {
if (identifier.namespace_id && identifier.identifier) {
collection_event.identifiers_attributes = [identifier]
}
if(JSON.stringify(CollectingEvent()) == JSON.stringify(collection_event)) {
if (JSON.stringify(CollectingEvent()) == JSON.stringify(collection_event)) {
return resolve(true)
}
else {
if(collection_event.id) {
} else {
if (collection_event.units === 'ft') {
['minimum_elevation', 'maximum_elevation', 'elevation_precision'].forEach(key => {
const elevationValue = Number(collection_event[key])
collection_event[key] = elevationValue > 0 ? elevationValue * 3.281 : undefined
})
}
if (collection_event.id) {
UpdateCollectionEvent(collection_event).then(response => {
commit(MutationNames.SetCollectionEvent, response.body)
if(state.collection_event.hasOwnProperty('identifiers') && state.collection_event.identifiers.length) {
Expand Down

0 comments on commit 6b10807

Please sign in to comment.