Sort on videoQuotaUsed in backend

This commit is contained in:
Chocobozzz 2019-07-25 11:15:03 +02:00
parent 41b15c8921
commit aa3796bda5
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 3 additions and 1 deletions

View File

@ -39,7 +39,7 @@ const WEBSERVER = {
// Sortable columns per schema // Sortable columns per schema
const SORTABLE_COLUMNS = { const SORTABLE_COLUMNS = {
USERS: [ 'id', 'username', 'createdAt' ], USERS: [ 'id', 'username', 'videoQuotaUsed', 'createdAt' ],
USER_SUBSCRIPTIONS: [ 'id', 'createdAt' ], USER_SUBSCRIPTIONS: [ 'id', 'createdAt' ],
ACCOUNTS: [ 'createdAt' ], ACCOUNTS: [ 'createdAt' ],
JOBS: [ 'createdAt' ], JOBS: [ 'createdAt' ],

View File

@ -13,6 +13,8 @@ function getSort (value: string, lastSort: OrderItem = [ 'id', 'ASC' ]): OrderIt
if (field.toLowerCase() === 'match') { // Search if (field.toLowerCase() === 'match') { // Search
finalField = Sequelize.col('similarity') finalField = Sequelize.col('similarity')
} else if (field === 'videoQuotaUsed') { // Users list
finalField = Sequelize.col('videoQuotaUsed')
} else { } else {
finalField = field finalField = field
} }