error on fetch/pull
reubano opened this issue · 3 comments
reubano commented
When I run @collection.storage.sync.pull()
or @collection.fetch()
I get the error TypeError: item.id is undefined
. Push works fine and posts to my restapi. Any idea what I'm doing wrong?
reubano commented
Well, the error was with createItem
. And the following fixes it
Sync.prototype.createItem = function(item) {
// console.log(item)
if (item.id && !_.include(this.storage.destroyIds.values, item.id.toString())) {
item.sid = item.id;
delete item.id;
return this.collection.items.create(item, {
local: true
});
}
};
The wierd part is that with the logging on, it spells 'success' with each item being one letter. I don't know why that is.
reubano commented
Another data point.... for ajax queries, the textStatus
argument is success
on successful calls.
Deleted user commented
Cool - thanks for the fix of the item.id is undefined bug!