mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 21:45:31 +09:00
fix(admin): ordering fixes for admin user search and meilisearch (#2920)
This commit is contained in:
1 parent
f2785941aa
commit
2f38bcdf26
3 files changed
+18
-4
No files matched your search
@@ -52,7 +52,8 @@ function snowflakeSeconds(snowflake: string): number {
|
||||
|
||||
function buildSort(sortBy: string, sortOrder: 'asc' | 'desc' | undefined): Array<string> | undefined {
|
||||
if (sortBy === 'relevance') return undefined;
|
||||
return [`${sortBy}:${sortOrder ?? 'desc'}`, 'id:desc'];
|
||||
const direction = sortOrder ?? 'desc';
|
||||
return [`${sortBy}:${direction}`, `id:${direction}`];
|
||||
}
|
||||
|
||||
function buildTimestampSort(filters: MessageSearchFilters | AuditLogSearchFilters): Array<string> | undefined {
|
||||
|
||||
@@ -117,7 +117,7 @@ describe('MeilisearchMessageAdapter', () => {
|
||||
'(guildId = "guild-1") AND ((channelId = "channel-\\"quoted\\"" OR channelId = "channel-2")) AND (mentionedUserIds = "user-1")',
|
||||
limit: 10,
|
||||
offset: 20,
|
||||
sort: ['createdAt:asc', 'id:desc'],
|
||||
sort: ['createdAt:asc', 'id:asc'],
|
||||
attributesToSearchOn: ['content', 'embedContent'],
|
||||
showRankingScore: false,
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user