SpeciesFileGroup/taxonworks

View on GitHub
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setFreeTextValue.js

Summary

Maintainability
A
3 hrs
Test Coverage
import mergeIntoObservation from '../helpers/mergeIntoObservation'
import setDescriptorUnsaved from '../helpers/setDescriptorUnsaved'

export default function (state, args) {
  const {
    descriptorId,
    description
  } = args

  mergeIntoObservation(state.observations.find(o => o.descriptorId === descriptorId), { description, isUnsaved: true })
  setDescriptorUnsaved(state.descriptors.find(d => d.id === descriptorId))
}