SpeciesFileGroup/taxonworks

View on GitHub
app/javascript/vue/tasks/digitize/store/mutations/CollectionObject/addCollectionObject.js

Summary

Maintainability
A
2 hrs
Test Coverage
export default (state, value) => {
  const index = state.collection_objects.findIndex((item) => item.id === value.id)

  if (index >= 0) {
    state.collection_objects[index] = value
  }
  else {
    state.collection_objects.push(value)
  }
}