From: Chocobozzz Date: Thu, 25 Jul 2019 09:15:03 +0000 (+0200) Subject: Sort on videoQuotaUsed in backend X-Git-Tag: v1.4.0-rc.1~73 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=aa3796bda5a6776e0d21048239f25d385a8e7545;p=oweals%2Fpeertube.git Sort on videoQuotaUsed in backend --- diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 5329d5fab..40f86a30d 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -39,7 +39,7 @@ const WEBSERVER = { // Sortable columns per schema const SORTABLE_COLUMNS = { - USERS: [ 'id', 'username', 'createdAt' ], + USERS: [ 'id', 'username', 'videoQuotaUsed', 'createdAt' ], USER_SUBSCRIPTIONS: [ 'id', 'createdAt' ], ACCOUNTS: [ 'createdAt' ], JOBS: [ 'createdAt' ], diff --git a/server/models/utils.ts b/server/models/utils.ts index 206e108c3..30de91e1d 100644 --- a/server/models/utils.ts +++ b/server/models/utils.ts @@ -13,6 +13,8 @@ function getSort (value: string, lastSort: OrderItem = [ 'id', 'ASC' ]): OrderIt if (field.toLowerCase() === 'match') { // Search finalField = Sequelize.col('similarity') + } else if (field === 'videoQuotaUsed') { // Users list + finalField = Sequelize.col('videoQuotaUsed') } else { finalField = field }