Sort on videoQuotaUsed in backend
This commit is contained in:
parent
41b15c8921
commit
aa3796bda5
|
@ -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' ],
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue