Skip to content

fix: server-side account sorting#1405

Open
LvyuanW wants to merge 1 commit intoWei-Shaw:mainfrom
LvyuanW:account-server-side-sort-main
Open

fix: server-side account sorting#1405
LvyuanW wants to merge 1 commit intoWei-Shaw:mainfrom
LvyuanW:account-server-side-sort-main

Conversation

@LvyuanW
Copy link
Copy Markdown
Contributor

@LvyuanW LvyuanW commented Mar 31, 2026

Summary

This fixes the sorting behavior in the Admin "Account Management" table.

Previously, clicking sortable table headers only reordered the current page on the client side, which made the result inconsistent once pagination was involved. This change moves account-table sorting to the server side so sorting is applied across the full result set.

What changed

  • enabled server-side sorting in the admin accounts table
  • persisted and sent sort_by / sort_order from the frontend account list requests
  • added backend support for account list sorting on supported columns
  • kept auto-refresh requests aligned with the current sort state
  • added repository coverage for cross-page sorting behavior

Root cause

The accounts page was using the shared table component's client-side sort mode, while the backend /admin/accounts endpoint always returned results in a fixed default order. As a result, header sorting only affected rows already loaded on the current page.

Validation

  • go test ./...
  • go test -tags=integration ./internal/repository -run 'TestAccountRepoSuite/TestListWithFilters_SortByNameAcrossPages'

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