Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added reply.status == 'more-exist' handling to get more then 100 results
  • Loading branch information
whatevercode committed May 20, 2012
1 parent 13faab8 commit bff9b02
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions option8_vertx/public/js/custom_sync.js
Expand Up @@ -33,7 +33,7 @@

var params = query(methodMap[method], model);

var replyHandler = function(reply){
var replyHandler = function(reply, replier){
var data;
if(params.action === 'save'){
data = {_id: reply._id || model.id};
Expand All @@ -42,9 +42,12 @@
if(params.action === 'find'){
data = model.id ? reply.results[0] : reply.results;
}
if(reply.status === 'ok'){
if(reply.status === 'ok' || reply.status == 'more-exist'){
options.success(data || model, reply.status, options);
model.eventBus.send('todos.broadcast.event', {model: model, method: method});
if(reply.status == 'more-exist'){
replier(new Object,replyHandler);
}
}else{
options.error(model, options);
}
Expand Down

0 comments on commit bff9b02

Please sign in to comment.