Skip to content

Conversation

@pavliuc75
Copy link
Contributor

can be merged without the backend being deployed first

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR extends the getParticipantsAccounts endpoint to support sorting by adding two new query parameters.

  • Introduce is_descending and order_by options in the method signature
  • Pass these new parameters through to the request params
Comments suppressed due to low confidence (2)

src/endpoints/study/recruitment.ts:98

  • Add a code comment or JSDoc block explaining the new is_descending and order_by parameters, including the allowed values and default behavior when omitted.
      params: {

src/endpoints/study/recruitment.ts:92

  • There are no tests covering the new sorting behavior. Please add or update unit/integration tests to verify that order_by and is_descending produce the expected API calls and response handling.
    is_descending?: boolean | null;

Comment on lines 98 to 105
params: {
limit,
offset,
search,
response_as_dto,
is_descending,
order_by,
},
Copy link

Copilot AI Jun 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider filtering out null or undefined values before sending the params object so that unwanted query strings (e.g., is_descending=null) are not included in the request URL.

Suggested change
params: {
limit,
offset,
search,
response_as_dto,
is_descending,
order_by,
},
params: Object.fromEntries(
Object.entries({
limit,
offset,
search,
response_as_dto,
is_descending,
order_by,
}).filter(([_, value]) => value != null),
),

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

github-actions bot commented Jun 24, 2025

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 85.03% (🎯 80%) 1529 / 1798
🟢 Statements 85.03% (🎯 80%) 1529 / 1798
🟢 Functions 86.17% (🎯 80%) 106 / 123
🟢 Branches 94.23% (🎯 80%) 147 / 156
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/endpoints/study/recruitment.ts 76.38% 100% 76.92% 76.38% 113-135, 190-195, 279-307
Generated in workflow #49 for commit cf165fc by the Vitest Coverage Report Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant