SpeciesFileGroup/taxonworks

View on GitHub
app/javascript/vue/tasks/images/new_image/store/mutations/addTag.js

Summary

Maintainability
A
3 hrs
Test Coverage
export default function(state, value) {
  let index = state.tags.findIndex(item => {
    return item.id == value.id
  })
  if(index > -1) {
    state.tags[index] = value
  }
  else {
    state.tags.push(value)
  }
}