epilogue icon indicating copy to clipboard operation
epilogue copied to clipboard

Option to change the defaultLimit on list pulls?

Open jblaketc opened this issue 8 years ago • 2 comments

If I pass /api/route?count=1000, it will get me more records than 100 on one pull, so I was wondering is there anyway to set that in a specific route, or do I have to overload the List milestone for each route I need more than 100 results for?

The reason I ask is because I have a dropdown with more than 100 options and I need to get them all in one go.

jblaketc avatar Jun 27 '16 21:06 jblaketc

@jblaketc you can do a write.before for the list controller and inject { count: 1000 } to the req.params

mbroadst avatar Jun 28 '16 00:06 mbroadst

Hmmmmm I ended up doing this:

ParamResource.list.fetch.before(function(req, res, context){
        req.query.count = 10000;
        return context.continue;
    });

Is there a preference to do it in the write milestone on a GET list?

jblaketc avatar Jul 12 '16 16:07 jblaketc