Fix storage.put
Adding an existing id to a collection is a no-op. To update an existing item, we must pass {merge: true} as an option. // FREEBIE
This commit is contained in:
parent
a3c6061480
commit
18e9ded296
1 changed files with 1 additions and 1 deletions
|
@ -24,7 +24,7 @@
|
||||||
put: function(key, value) {
|
put: function(key, value) {
|
||||||
if (value === undefined)
|
if (value === undefined)
|
||||||
throw new Error("Tried to store undefined");
|
throw new Error("Tried to store undefined");
|
||||||
var item = items.add({id: key, value: value});
|
var item = items.add({id: key, value: value}, {merge: true});
|
||||||
item.save();
|
item.save();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue