릴리스: v1.3.12 회원 정렬 방향과 입력 길이 피드백
This commit is contained in:
@@ -513,7 +513,7 @@ async function findPrimaryAdminUser() {
|
||||
return mapUserRow(rows[0])
|
||||
}
|
||||
|
||||
async function listUsers({ queryText = '', sort = 'recent' } = {}) {
|
||||
async function listUsers({ queryText = '', sort = 'recent', direction = 'desc' } = {}) {
|
||||
const where = []
|
||||
const params = []
|
||||
const trimmedQuery = typeof queryText === 'string' ? queryText.trim() : ''
|
||||
@@ -523,12 +523,19 @@ async function listUsers({ queryText = '', sort = 'recent' } = {}) {
|
||||
params.push(`%${trimmedQuery}%`, `%${trimmedQuery}%`)
|
||||
}
|
||||
|
||||
const isAsc = direction === 'asc'
|
||||
const orderBy =
|
||||
sort === 'created'
|
||||
? 'u.created_at DESC, recent_activity_at DESC, u.email ASC'
|
||||
? isAsc
|
||||
? 'u.created_at ASC, recent_activity_at ASC, u.email ASC'
|
||||
: 'u.created_at DESC, recent_activity_at DESC, u.email ASC'
|
||||
: sort === 'tierlists'
|
||||
? 'tierlist_count DESC, recent_activity_at DESC, u.email ASC'
|
||||
: 'recent_activity_at DESC, u.created_at ASC, u.email ASC'
|
||||
? isAsc
|
||||
? 'tierlist_count ASC, recent_activity_at ASC, u.email ASC'
|
||||
: 'tierlist_count DESC, recent_activity_at DESC, u.email ASC'
|
||||
: isAsc
|
||||
? 'recent_activity_at ASC, u.created_at ASC, u.email ASC'
|
||||
: 'recent_activity_at DESC, u.created_at ASC, u.email ASC'
|
||||
|
||||
const rows = await query(
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user