diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-11-13 18:48:28 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-11-27 19:40:51 +0100 |
commit | ce548a10db3822c415b30ea0edb59e02a460734a (patch) | |
tree | b39127c62101b5bf47e0a8a3c30bc70d6449824d /server/models/account | |
parent | 7a7724e66e4533523083e7336cd0d0c747c4a33b (diff) | |
download | PeerTube-ce548a10db3822c415b30ea0edb59e02a460734a.tar.gz PeerTube-ce548a10db3822c415b30ea0edb59e02a460734a.tar.zst PeerTube-ce548a10db3822c415b30ea0edb59e02a460734a.zip |
Send follow/accept
Diffstat (limited to 'server/models/account')
-rw-r--r-- | server/models/account/account-interface.ts | 2 | ||||
-rw-r--r-- | server/models/account/account.ts | 6 |
2 files changed, 5 insertions, 3 deletions
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 { | |||
10 | 10 | ||
11 | export type Load = (id: number) => Bluebird<AccountInstance> | 11 | export type Load = (id: number) => Bluebird<AccountInstance> |
12 | export type LoadByUUID = (uuid: string) => Bluebird<AccountInstance> | 12 | export type LoadByUUID = (uuid: string) => Bluebird<AccountInstance> |
13 | export type LoadByUrl = (url: string) => Bluebird<AccountInstance> | 13 | export type LoadByUrl = (url: string, transaction?: Sequelize.Transaction) => Bluebird<AccountInstance> |
14 | export type LoadAccountByPodAndUUID = (uuid: string, podId: number, transaction: Sequelize.Transaction) => Bluebird<AccountInstance> | 14 | export type LoadAccountByPodAndUUID = (uuid: string, podId: number, transaction: Sequelize.Transaction) => Bluebird<AccountInstance> |
15 | export type LoadLocalAccountByNameAndPod = (name: string, host: string) => Bluebird<AccountInstance> | 15 | export type LoadLocalAccountByNameAndPod = (name: string, host: string) => Bluebird<AccountInstance> |
16 | export type ListOwned = () => Bluebird<AccountInstance[]> | 16 | export type ListOwned = () => Bluebird<AccountInstance[]> |
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 | |||
198 | loadApplication, | 198 | loadApplication, |
199 | load, | 199 | load, |
200 | loadByUUID, | 200 | loadByUUID, |
201 | loadByUrl, | ||
201 | loadLocalAccountByNameAndPod, | 202 | loadLocalAccountByNameAndPod, |
202 | listOwned, | 203 | listOwned, |
203 | listFollowerUrlsForApi, | 204 | listFollowerUrlsForApi, |
@@ -480,11 +481,12 @@ loadLocalAccountByNameAndPod = function (name: string, host: string) { | |||
480 | return Account.findOne(query) | 481 | return Account.findOne(query) |
481 | } | 482 | } |
482 | 483 | ||
483 | loadByUrl = function (url: string) { | 484 | loadByUrl = function (url: string, transaction?: Sequelize.Transaction) { |
484 | const query: Sequelize.FindOptions<AccountAttributes> = { | 485 | const query: Sequelize.FindOptions<AccountAttributes> = { |
485 | where: { | 486 | where: { |
486 | url | 487 | url |
487 | } | 488 | }, |
489 | transaction | ||
488 | } | 490 | } |
489 | 491 | ||
490 | return Account.findOne(query) | 492 | return Account.findOne(query) |