feat(auth-manager)!: added support for pagination and sort for domain#69
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds pagination and sorting support to the domain management features. The key changes include:
- Updating the DomainManager API to accept pagination and sorting parameters and return a tuple of [domains, count].
- Adjusting controller and integration tests to handle the new return structure and validate the API response.
- Updating the OpenAPI specification to document the new query parameters and response format.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/auth-manager/tests/unit/domain/models/domainModel.spec.ts | Updated mocked repository method from find to findAndCount, but the expected output in the test was not updated to reflect the new tuple structure. |
| packages/auth-manager/tests/integration/domain/domain.spec.ts | Adjusted response parsing and added a ts-expect-error for openapi-helpers type issues. |
| packages/auth-manager/src/domain/models/domainManager.ts | Modified getDomains to incorporate pagination and sort options and to return a tuple of [results, count]. |
| packages/auth-manager/src/domain/controllers/domainController.ts | Updated the controller to parse query parameters and return an object with items and total. |
| packages/auth-manager/openapi3.yaml | Enhanced documentation to define sorting, pagination parameters, and updated response schema. |
Comments suppressed due to low confidence (1)
packages/auth-manager/tests/unit/domain/models/domainModel.spec.ts:22
- The expected value in this test does not match the updated return type of getDomains, which now returns a tuple [domains, count]. Consider updating the expectation to reflect the tuple structure, for example: await expect(domainPromise).resolves.toStrictEqual([[{ name: 'avi' }], 1]).
await expect(domainPromise).resolves.toStrictEqual([{ name: 'avi' }]);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.