From ce548a10db3822c415b30ea0edb59e02a460734a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 13 Nov 2017 18:48:28 +0100 Subject: Send follow/accept --- server/models/account/account-interface.ts | 2 +- server/models/account/account.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'server/models/account') diff --git a/server/models/account/account-interface.ts b/server/models/account/account-interface.ts index d49dfbe17..73701f233 100644 --- a/server/models/account/account-interface.ts +++ b/server/models/account/account-interface.ts @@ -10,7 +10,7 @@ export namespace AccountMethods { export type Load = (id: number) => Bluebird export type LoadByUUID = (uuid: string) => Bluebird - export type LoadByUrl = (url: string) => Bluebird + export type LoadByUrl = (url: string, transaction?: Sequelize.Transaction) => Bluebird export type LoadAccountByPodAndUUID = (uuid: string, podId: number, transaction: Sequelize.Transaction) => Bluebird export type LoadLocalAccountByNameAndPod = (name: string, host: string) => Bluebird export type ListOwned = () => Bluebird diff --git a/server/models/account/account.ts b/server/models/account/account.ts index daf8f4703..7ce97b2fd 100644 --- a/server/models/account/account.ts +++ b/server/models/account/account.ts @@ -198,6 +198,7 @@ export default function defineAccount (sequelize: Sequelize.Sequelize, DataTypes loadApplication, load, loadByUUID, + loadByUrl, loadLocalAccountByNameAndPod, listOwned, listFollowerUrlsForApi, @@ -480,11 +481,12 @@ loadLocalAccountByNameAndPod = function (name: string, host: string) { return Account.findOne(query) } -loadByUrl = function (url: string) { +loadByUrl = function (url: string, transaction?: Sequelize.Transaction) { const query: Sequelize.FindOptions = { where: { url - } + }, + transaction } return Account.findOne(query) -- cgit v1.2.3