SpeciesFileGroup/taxonworks

View on GitHub
app/javascript/vue/tasks/collecting_events/new_collecting_event/store/mutations/addGeoreference.js

Summary

Maintainability
A
2 hrs
Test Coverage
export default (state, georeference) => {
  const index = state.georeferences.findIndex(item => item.id === georeference.id)
  if (index > -1) {
    state.georeferences[index] = georeference
  } else {
    state.georeferences.push(georeference)
  }
}