eldomagan/vuex-orm-localforage

Uncaught TypeError using $update

ZeroThe2nd opened this issue · 0 comments

When updating data with the following:

Model.$update(
  { where : 1 },
  data : {
    field: 'value'}
  )

I'm receiving the following error:
Uncaught (in promise) TypeError: result[entity].forEach is not a function

The error is referring to the result[entity].forEach( ... ) on line 18 of src/actions/Persist.js, and when executing a $update, entity in result[entity] contains the string value $id. The contents of result are is the model in question.

Repeating this through the debugger with a Model.$create, the contents of entity is the string value operations, and result is an object with key operations holding an array of values that should be saved.

The value is not updated in the database, nor in vuex itself when using $update, while $create works without errors or issues.