department-of-veterans-affairs/vets-website

View on GitHub
src/applications/edu-benefits/5490/config/prefill-transformer.js

Summary

Maintainability
A
0 mins
Test Coverage
import _ from 'lodash';

export function prefillTransformer(pages, formData, metadata, state) {
  const { edipi, icn } = state.user.profile;

  const newFormData = {
    ..._.omit(formData, ['edipi', 'icn']),
    edipi,
    icn,
  };

  return {
    metadata,
    formData: newFormData,
    pages,
  };
}