@@ -79,7 +79,8 @@ export default function makeBaseModel(options: FeathersVuexOptions) {
79
79
public static serverAlias : string = options . serverAlias
80
80
81
81
public static readonly models = globalModels as GlobalModels // Can access other Models here
82
- public static copiesById : {
82
+
83
+ public static readonly copiesById : {
83
84
[ key : string ] : Model | undefined
84
85
[ key : number ] : Model | undefined
85
86
} = { }
@@ -365,7 +366,9 @@ export default function makeBaseModel(options: FeathersVuexOptions) {
365
366
* Calls service patch with the current instance data
366
367
* @param params
367
368
*/
368
- public patch < D extends { } = AnyData > ( params ?: PatchParams < D > ) : Promise < this> {
369
+ public patch < D extends { } = AnyData > (
370
+ params ?: PatchParams < D >
371
+ ) : Promise < this> {
369
372
const { idField, _dispatch } = this . constructor as typeof BaseModel
370
373
const id = getId ( this , idField )
371
374
@@ -410,7 +413,9 @@ export default function makeBaseModel(options: FeathersVuexOptions) {
410
413
}
411
414
return _dispatch . call ( this . constructor , 'remove' , [ id , params ] )
412
415
} else {
416
+ // is temp
413
417
_commit . call ( this . constructor , 'removeTemps' , [ this [ tempIdField ] ] )
418
+ _commit . call ( this . constructor , 'clearCopy' , [ this [ tempIdField ] ] )
414
419
return Promise . resolve ( this )
415
420
}
416
421
}
0 commit comments