File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -232,6 +232,12 @@ Removes a single item. `item` can be
232
232
233
233
- ` item {Number|String|Object} ` - The item or id of the item to be deleted.
234
234
235
+ ### ` removeTemps(state, tempIds) `
236
+
237
+ // Removes temp records. Also cleans up tempsByNewId
238
+
239
+ - ` items {Array} ` - An array of ids or of objects with tempIds that will be removed from the data store
240
+
235
241
### ` removeItems(state, items) `
236
242
237
243
Removes the passed in items or ids from the store.
Original file line number Diff line number Diff line change @@ -179,10 +179,10 @@ export default function makeServiceMutations() {
179
179
removeTemps ( state , tempIds ) {
180
180
const ids = tempIds . reduce ( ( ids , id ) => {
181
181
const temp = state . tempsById [ id ]
182
- if ( temp && temp [ state . idField ] ) {
182
+ if ( temp && temp [ state . tempIdField ] ) {
183
183
delete temp . __isTemp
184
184
Vue . delete ( temp , '__isTemp' )
185
- ids . push ( temp [ state . idField ] )
185
+ ids . push ( temp [ state . tempIdField ] )
186
186
}
187
187
return ids
188
188
} , [ ] )
You can’t perform that action at this time.
0 commit comments