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:
lilia 2016-02-17 16:09:06 -08:00
parent a3c6061480
commit 18e9ded296
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@
put: function(key, value) {
if (value === 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();
},