adopted-ember-addons / validated-changeset

Buffering changes to form data
MIT License
36 stars 27 forks source link

Fix restore method to work with nested keys #160

Closed linainu closed 2 years ago

linainu commented 2 years ago

restore method converted snapshot with nested keys

{
  changes: { name: 'Jim Bob', address: { country: 'North Korea' } },
  errors: {}
}

into changeset with changes like below

[
  { key: 'name', value: 'Jim Bob' },
  { key: 'address', value: { country: 'North Korea' } }
]

fixed it to be:

[
  { key: 'name', value: 'Jim Bob' },
  { key: 'address.country', value: 'North Korea' }
]