Skip to content

fix: correct shortcodes filter query#1525

Open
ChongJiaChua wants to merge 2 commits into
developfrom
850_Fix_Proposals_Query_Shortcodes_Filter
Open

fix: correct shortcodes filter query#1525
ChongJiaChua wants to merge 2 commits into
developfrom
850_Fix_Proposals_Query_Shortcodes_Filter

Conversation

@ChongJiaChua
Copy link
Copy Markdown
Contributor

@ChongJiaChua ChongJiaChua commented May 21, 2026

Closes UserOfficeProject/issue-tracker/issues/850

Description

The GraphQL proposals query's shortcodes filter was matching against proposals.proposal_id instead of matching against the call shortcode, causing the filter to always return a empty list. The filter has been updated to correctly perform a query lookup on the call table so that it returns the correct proposals for a given call shortcode.

Motivation and Context

How Has This Been Tested

Sending the query below to the graphql end point with a list of short codes returns the correct list of proposals

query {
proposals(filter:{shortCodes:[list of call short codes]}){
proposals {
primaryKey
proposalId
call {
shortCode
id
}
}
}
}

Fixes

Changes

Replaced the query.whereRaw(proposal_id similar to '%(${filteredAndPreparedShortCodes})%'partial string matching in ProposalDataSource.ts and StfcProposalDataSource.ts with a subquery that filters call_id based on matching call_short_code in the call table.

Depends on

Tests included/Docs Updated?

  • I have added tests to cover my changes.
  • All relevant doc has been updated

@ChongJiaChua ChongJiaChua requested a review from a team as a code owner May 21, 2026 08:16
@ChongJiaChua ChongJiaChua requested review from Scott-James-Hurley and removed request for a team May 21, 2026 08:16
@ChongJiaChua ChongJiaChua self-assigned this May 21, 2026
@ChongJiaChua ChongJiaChua changed the title fix: correct shortcodes filter query fix: correct shortcodes filter query May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Filtering proposals by short codes is not returning proposals

1 participant