mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
Update follower/following counts
This commit is contained in:
parent
6502c3d43e
commit
32b2b43c06
8 changed files with 108 additions and 1 deletions
|
@ -264,6 +264,16 @@ export class ActorModel extends Model<ActorModel> {
|
|||
return ActorModel.scope(ScopeNames.FULL).findOne(query)
|
||||
}
|
||||
|
||||
static incrementFollows (id: number, column: 'followersCount' | 'followingCount', by: number) {
|
||||
// FIXME: typings
|
||||
return (ActorModel as any).increment(column, {
|
||||
by,
|
||||
where: {
|
||||
id
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
toFormattedJSON () {
|
||||
let avatar: Avatar = null
|
||||
if (this.Avatar) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue