]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/actor/actor-follow.ts
Merge branch 'release/3.2.0' into develop
[github/Chocobozzz/PeerTube.git] / server / models / actor / actor-follow.ts
index 4c5f376202b7fbb207b03bad70ef7d11beb0316e..3a09e51d6feffae7bd59ddba02cb7a9af01b8afb 100644 (file)
@@ -28,6 +28,7 @@ import {
   MActorFollowFormattable,
   MActorFollowSubscriptions
 } from '@server/types/models'
+import { AttributesOnly } from '@shared/core-utils'
 import { ActivityPubActorType } from '@shared/models'
 import { FollowState } from '../../../shared/models/actors'
 import { ActorFollow } from '../../../shared/models/actors/follow.model'
@@ -61,7 +62,7 @@ import { ActorModel, unusedActorAttributesForAPI } from './actor'
     }
   ]
 })
-export class ActorFollowModel extends Model {
+export class ActorFollowModel extends Model<Partial<AttributesOnly<ActorFollowModel>>> {
 
   @AllowNull(false)
   @Column(DataType.ENUM(...values(FOLLOW_STATES)))
@@ -619,7 +620,7 @@ export class ActorFollowModel extends Model {
     if (serverIds.length === 0) return
 
     const me = await getServerActor()
-    const serverIdsString = createSafeIn(ActorFollowModel, serverIds)
+    const serverIdsString = createSafeIn(ActorFollowModel.sequelize, serverIds)
 
     const query = `UPDATE "actorFollow" SET "score" = LEAST("score" + ${value}, ${ACTOR_FOLLOW_SCORE.MAX}) ` +
       'WHERE id IN (' +