Skip to content

Commit a0043ec

Browse files
committed
Bump treatments default limit default to 1000 objects for queries that include other query parameters
1 parent 8a1d6bf commit a0043ec

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/api/treatments/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ function configure (app, wares, ctx, env) {
8686
// List treatments available
8787
api.get('/treatments', function(req, res) {
8888
var query = req.query;
89-
if (!query.count) { query.count = 100; }
89+
if (!query.count) {
90+
// If there's a date search involved, default to a higher number of objects
91+
query.count = query.find ? 1000 : 100;
92+
}
9093

9194
const inMemoryData = ctx.ddata.shadow.treatments;
9295
const canServeFromMemory = inMemoryData && inMemoryData.length >= query.count && Object.keys(query).length == 1 ? true : false;

0 commit comments

Comments
 (0)