api: add limit as query parameter
This commit is contained in:
committed by
Carl-Gerhard Lindesvärd
parent
e6f3b94aa2
commit
645b9ca9d4
@@ -56,6 +56,7 @@ export async function events(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const take = Math.max(Math.min(query.limit, 50), 1);
|
||||||
const cursor = (parseInt(query.page || '1', 10) || 1) - 1;
|
const cursor = (parseInt(query.page || '1', 10) || 1) - 1;
|
||||||
const options: GetEventListOptions = {
|
const options: GetEventListOptions = {
|
||||||
projectId,
|
projectId,
|
||||||
@@ -65,7 +66,7 @@ export async function events(
|
|||||||
startDate: query.start ? new Date(query.start) : undefined,
|
startDate: query.start ? new Date(query.start) : undefined,
|
||||||
endDate: query.end ? new Date(query.end) : undefined,
|
endDate: query.end ? new Date(query.end) : undefined,
|
||||||
cursor,
|
cursor,
|
||||||
take: 50,
|
take,
|
||||||
meta: false,
|
meta: false,
|
||||||
profile: true,
|
profile: true,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user