Skip to content

Commit daa9a1e

Browse files
authored
FIX Can't call update when id is 0
Fix for Databases that use numbers as ID's and model's with id 0 should be able to call 'update'.
1 parent 9a83f0e commit daa9a1e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/service-module/make-base-model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ export default function makeBaseModel(options: FeathersVuexOptions) {
421421
const { idField, _dispatch } = this.constructor as typeof BaseModel
422422
const id = getId(this, idField)
423423

424-
if (!id) {
424+
if (id !== 0 && !id) {
425425
const error = new Error(
426426
`Missing ${idField} property. You must create the data before you can update with this data`
427427
)

0 commit comments

Comments
 (0)