SpeciesFileGroup/taxonworks

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

Summary

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