Fix: Implement sorting functionality

This commit is contained in:
gpt-engineer-app[bot]
2025-10-13 12:29:01 +00:00
parent 5e83d8a75f
commit 284f778fc6
5 changed files with 65 additions and 16 deletions

View File

@@ -27,12 +27,6 @@ export function sortModerationItems(
comparison = new Date(a.created_at).getTime() - new Date(b.created_at).getTime();
break;
case 'username':
const usernameA = a.user_profile?.username || a.user_profile?.display_name || '';
const usernameB = b.user_profile?.username || b.user_profile?.display_name || '';
comparison = usernameA.localeCompare(usernameB);
break;
case 'submission_type':
comparison = (a.submission_type || '').localeCompare(b.submission_type || '');
break;
@@ -123,8 +117,6 @@ export function getSortFieldLabel(field: SortField): string {
switch (field) {
case 'created_at':
return 'Date Created';
case 'username':
return 'Submitter';
case 'submission_type':
return 'Type';
case 'status':