Add more filters to admin follows table
This commit is contained in:
parent
97ecddae10
commit
cb5ce4cb13
5 changed files with 23 additions and 13 deletions
|
@ -58,6 +58,19 @@ function getBlacklistSort (model: any, value: string, lastSort: OrderItem = [ 'i
|
|||
return [ firstSort, lastSort ]
|
||||
}
|
||||
|
||||
function getFollowsSort (value: string, lastSort: OrderItem = [ 'id', 'ASC' ]): OrderItem[] {
|
||||
const { direction, field } = buildDirectionAndField(value)
|
||||
|
||||
if (field === 'redundancyAllowed') {
|
||||
return [
|
||||
[ 'ActorFollowing', 'Server', 'redundancyAllowed', direction ],
|
||||
lastSort
|
||||
]
|
||||
}
|
||||
|
||||
return getSort(value, lastSort)
|
||||
}
|
||||
|
||||
function isOutdated (model: { createdAt: Date, updatedAt: Date }, refreshInterval: number) {
|
||||
const now = Date.now()
|
||||
const createdAtTime = model.createdAt.getTime()
|
||||
|
@ -163,6 +176,7 @@ export {
|
|||
buildWhereIdOrUUID,
|
||||
isOutdated,
|
||||
parseAggregateResult,
|
||||
getFollowsSort,
|
||||
createSafeIn
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue