Skip to content

Pagination Limit and sorting for sessionService.listSessions #324

@rialytics-software

Description

@rialytics-software

** Please make sure you read the contribution guide and file the issues in the
right place. **
Contribution guide.

Is your feature request related to a problem? Please describe.
To implement the default Database Session Service; we have to list sessions ordered by updatedAt (descending order). (Get the latest sessions first) But i only want to fetch last 10 sessions first.

Describe the solution you'd like
Adding parameters like page; offset and limit should resolve this issue.

Describe alternatives you've considered
We have to create limits in the UI/API controller. Which is not scalable.

Additional context

const sessions = await sessionService.listSessions({
            userId:  req.userId!,
            appName,
            limit: 10, // Need this
            offset: 0, // Need this
            page:1, // Need this
            order: "desc", // Need this
        });

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestneeds review[Status] The PR/issue is awaiting review from the maintainer

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions