diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-11-23 14:19:55 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-11-27 19:40:53 +0100 |
commit | 0032ebe94aa83fab761c7de3ceb6210ac4532824 (patch) | |
tree | 3ea407d7ea6de4c7f7bc66caba7e23c0cc4036e3 /server/models | |
parent | d52eb8f656242c7e34afdb2dee681861fb9bce35 (diff) | |
download | PeerTube-0032ebe94aa83fab761c7de3ceb6210ac4532824.tar.gz PeerTube-0032ebe94aa83fab761c7de3ceb6210ac4532824.tar.zst PeerTube-0032ebe94aa83fab761c7de3ceb6210ac4532824.zip |
Federate likes/dislikes
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/account/account-follow-interface.ts | 6 | ||||
-rw-r--r-- | server/models/account/account-follow.ts | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/server/models/account/account-follow-interface.ts b/server/models/account/account-follow-interface.ts index 6f228c790..a0d620dd0 100644 --- a/server/models/account/account-follow-interface.ts +++ b/server/models/account/account-follow-interface.ts | |||
@@ -5,7 +5,11 @@ import { ResultList } from '../../../shared/models/result-list.model' | |||
5 | import { AccountInstance } from './account-interface' | 5 | import { AccountInstance } from './account-interface' |
6 | 6 | ||
7 | export namespace AccountFollowMethods { | 7 | export namespace AccountFollowMethods { |
8 | export type LoadByAccountAndTarget = (accountId: number, targetAccountId: number) => Bluebird<AccountFollowInstance> | 8 | export type LoadByAccountAndTarget = ( |
9 | accountId: number, | ||
10 | targetAccountId: number, | ||
11 | t?: Sequelize.Transaction | ||
12 | ) => Bluebird<AccountFollowInstance> | ||
9 | 13 | ||
10 | export type ListFollowingForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList<AccountFollowInstance>> | 14 | export type ListFollowingForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList<AccountFollowInstance>> |
11 | export type ListFollowersForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList<AccountFollowInstance>> | 15 | export type ListFollowersForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList<AccountFollowInstance>> |
diff --git a/server/models/account/account-follow.ts b/server/models/account/account-follow.ts index 578bcda39..8e35c7d20 100644 --- a/server/models/account/account-follow.ts +++ b/server/models/account/account-follow.ts | |||
@@ -93,7 +93,7 @@ toFormattedJSON = function (this: AccountFollowInstance) { | |||
93 | return json | 93 | return json |
94 | } | 94 | } |
95 | 95 | ||
96 | loadByAccountAndTarget = function (accountId: number, targetAccountId: number) { | 96 | loadByAccountAndTarget = function (accountId: number, targetAccountId: number, t?: Sequelize.Transaction) { |
97 | const query = { | 97 | const query = { |
98 | where: { | 98 | where: { |
99 | accountId, | 99 | accountId, |
@@ -110,7 +110,8 @@ loadByAccountAndTarget = function (accountId: number, targetAccountId: number) { | |||
110 | required: true, | 110 | required: true, |
111 | as: 'AccountFollowing' | 111 | as: 'AccountFollowing' |
112 | } | 112 | } |
113 | ] | 113 | ], |
114 | transaction: t | ||
114 | } | 115 | } |
115 | 116 | ||
116 | return AccountFollow.findOne(query) | 117 | return AccountFollow.findOne(query) |