Skip to content

Use SqlBuilder for NGO list sorting and allow sorting by NumberOfStaff - #1112

Merged
idormenco merged 1 commit into
mainfrom
feat/ngo-list-sql-builder
Oct 14, 2026
Merged

idormenco merged 1 commit into
mainfrom
feat/ngo-list-sql-builder

Conversation

@idormenco

Copy link
Copy Markdown
Contributor

Summary

  • Rewrite the platform-admin GET /api/ngos query with Dapper SqlBuilder (same pattern as the form-submissions list endpoints) instead of CASE WHEN @sortExpression = ... sorting.
  • Add NumberOfStaff as a sortable column.
  • Search text and status filters are added as /**where**/ clauses only when provided; count and page queries share them.
  • Sort column is mapped to a whitelisted ORDER BY clause; unknown/empty columns fall back to Name ASC (previously an unknown column fell back to Name DESC, and an explicit Name sort ignored the requested direction).

Test plan

  • List NGOs as platform admin sorted by each column (Name, Status, NumberOfNgoAdmins, NumberOfStaff, NumberOfMonitoredElections, DateOfLastElection), both directions
  • Filter by search text and status, verify total count matches

@vercel

vercel Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
votemonitor Ready Ready Preview Oct 14, 2026 7:34am UTC

Request Review

@idormenco
idormenco merged commit 35140fc into main Oct 14, 2026
3 of 4 checks passed
@idormenco
idormenco deleted the feat/ngo-list-sql-builder branch October 14, 2026 07:34

This branch was successfully deployed

1 active deployment
Preview — fee21996 Deployed Oct 14, 2026 by vercel[bot]
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