From 0032ebe94aa83fab761c7de3ceb6210ac4532824 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 23 Nov 2017 14:19:55 +0100 Subject: Federate likes/dislikes --- server/models/account/account-follow-interface.ts | 6 +++++- server/models/account/account-follow.ts | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'server/models') 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' import { AccountInstance } from './account-interface' export namespace AccountFollowMethods { - export type LoadByAccountAndTarget = (accountId: number, targetAccountId: number) => Bluebird + export type LoadByAccountAndTarget = ( + accountId: number, + targetAccountId: number, + t?: Sequelize.Transaction + ) => Bluebird export type ListFollowingForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList> export type ListFollowersForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList> 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) { return json } -loadByAccountAndTarget = function (accountId: number, targetAccountId: number) { +loadByAccountAndTarget = function (accountId: number, targetAccountId: number, t?: Sequelize.Transaction) { const query = { where: { accountId, @@ -110,7 +110,8 @@ loadByAccountAndTarget = function (accountId: number, targetAccountId: number) { required: true, as: 'AccountFollowing' } - ] + ], + transaction: t } return AccountFollow.findOne(query) -- cgit v1.2.3