diff options
author | Chocobozzz <me@florianbigard.com> | 2019-07-25 11:15:03 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-07-25 11:15:03 +0200 |
commit | aa3796bda5a6776e0d21048239f25d385a8e7545 (patch) | |
tree | 68f48c085c225d7969ff4f5a75d3f916e50452fb | |
parent | 41b15c892192073828458d007256a9dfdf3bb6fb (diff) | |
download | PeerTube-aa3796bda5a6776e0d21048239f25d385a8e7545.tar.gz PeerTube-aa3796bda5a6776e0d21048239f25d385a8e7545.tar.zst PeerTube-aa3796bda5a6776e0d21048239f25d385a8e7545.zip |
Sort on videoQuotaUsed in backend
-rw-r--r-- | server/initializers/constants.ts | 2 | ||||
-rw-r--r-- | server/models/utils.ts | 2 |
2 files changed, 3 insertions, 1 deletions
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 = { | |||
39 | 39 | ||
40 | // Sortable columns per schema | 40 | // Sortable columns per schema |
41 | const SORTABLE_COLUMNS = { | 41 | const SORTABLE_COLUMNS = { |
42 | USERS: [ 'id', 'username', 'createdAt' ], | 42 | USERS: [ 'id', 'username', 'videoQuotaUsed', 'createdAt' ], |
43 | USER_SUBSCRIPTIONS: [ 'id', 'createdAt' ], | 43 | USER_SUBSCRIPTIONS: [ 'id', 'createdAt' ], |
44 | ACCOUNTS: [ 'createdAt' ], | 44 | ACCOUNTS: [ 'createdAt' ], |
45 | JOBS: [ 'createdAt' ], | 45 | 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 | |||
13 | 13 | ||
14 | if (field.toLowerCase() === 'match') { // Search | 14 | if (field.toLowerCase() === 'match') { // Search |
15 | finalField = Sequelize.col('similarity') | 15 | finalField = Sequelize.col('similarity') |
16 | } else if (field === 'videoQuotaUsed') { // Users list | ||
17 | finalField = Sequelize.col('videoQuotaUsed') | ||
16 | } else { | 18 | } else { |
17 | finalField = field | 19 | finalField = field |
18 | } | 20 | } |