Skip to content

Commit 9601217

Browse files
Merge pull request #566 from DaniGTA/patch-1
FIX Can't call update when id is 0
2 parents cd257ab + daa9a1e commit 9601217

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)