Skip to content

Commit e405548

Browse files
committed
fix: new/temp records should have a tempId
New and temporary records did not get a tempId assigned because the boolean check on line 102 was returning false. This fixes the check so the tempId is properly assigned.
1 parent 03274c6 commit e405548

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/service-module/make-model.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ export default function makeModel(options: FeathersVuexOptions) {
9999
} = this.constructor as typeof BaseModel
100100
const id = getId(data, idField)
101101
const hasValidId = id !== null && id !== undefined
102-
const tempId = data && data.hasOwnProperty(tempIdField) && data[tempIdField]
102+
const tempId =
103+
data && data.hasOwnProperty(tempIdField) ? data[tempIdField] : undefined
103104
const hasValidTempId = tempId !== null && tempId !== undefined
104105
const copiesById = keepCopiesInStore
105106
? store.state[namespace].copiesById

0 commit comments

Comments
 (0)