feathersjs-ecosystem / feathers-vuex

Integration of FeathersJS, Vue, and Nuxt for the artisan developer

Home Page:https://vuex.feathersjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Can't call 'update' on model with id 0

DaniGTA opened this issue · comments

commented

Steps to reproduce

Have a database with ids like 0, 1, 2, 3, 4... and so on
create a model with id 0 and try to update it

Expected behavior

Should call _dispatch.call(this.constructor, 'update', [id, this, params])

Actual behavior

Calls:

const error = new Error(
  `Missing ${idField} property. You must create the data before you can update with this data`
)
return Promise.reject(error)

Caused by:

make-base-model.js

330: if (!id) {

}

when id is 0 it cant update. It must check if it is undefined or null.