feat(core): Add filtering, selection and pagination to users (#6994)

https://linear.app/n8n/issue/PAY-646
This commit is contained in:
Iván Ovejero
2023-08-28 16:13:17 +02:00
committed by GitHub
parent a7785b2c5d
commit b716241b42
23 changed files with 535 additions and 211 deletions

View File

@@ -11,9 +11,13 @@ export const paginationListQueryMiddleware: RequestHandler = (
) => {
const { take: rawTake, skip: rawSkip = '0' } = req.query;
if (!rawTake) return next();
try {
if (!rawTake && req.query.skip) {
throw new Error('Please specify `take` when using `skip`');
}
if (!rawTake) return next();
const { take, skip } = Pagination.fromString(rawTake, rawSkip);
req.listQueryOptions = { ...req.listQueryOptions, skip, take };