aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/account/account.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/account/account.ts')
-rw-r--r--server/models/account/account.ts20
1 files changed, 10 insertions, 10 deletions
diff --git a/server/models/account/account.ts b/server/models/account/account.ts
index 7ce97b2fd..6ef29c8b7 100644
--- a/server/models/account/account.ts
+++ b/server/models/account/account.ts
@@ -33,8 +33,8 @@ let loadByUUID: AccountMethods.LoadByUUID
33let loadByUrl: AccountMethods.LoadByUrl 33let loadByUrl: AccountMethods.LoadByUrl
34let loadLocalAccountByNameAndPod: AccountMethods.LoadLocalAccountByNameAndPod 34let loadLocalAccountByNameAndPod: AccountMethods.LoadLocalAccountByNameAndPod
35let listOwned: AccountMethods.ListOwned 35let listOwned: AccountMethods.ListOwned
36let listFollowerUrlsForApi: AccountMethods.ListFollowerUrlsForApi 36let listAcceptedFollowerUrlsForApi: AccountMethods.ListAcceptedFollowerUrlsForApi
37let listFollowingUrlsForApi: AccountMethods.ListFollowingUrlsForApi 37let listAcceptedFollowingUrlsForApi: AccountMethods.ListAcceptedFollowingUrlsForApi
38let listFollowingForApi: AccountMethods.ListFollowingForApi 38let listFollowingForApi: AccountMethods.ListFollowingForApi
39let listFollowersForApi: AccountMethods.ListFollowersForApi 39let listFollowersForApi: AccountMethods.ListFollowersForApi
40let isOwned: AccountMethods.IsOwned 40let isOwned: AccountMethods.IsOwned
@@ -201,8 +201,8 @@ export default function defineAccount (sequelize: Sequelize.Sequelize, DataTypes
201 loadByUrl, 201 loadByUrl,
202 loadLocalAccountByNameAndPod, 202 loadLocalAccountByNameAndPod,
203 listOwned, 203 listOwned,
204 listFollowerUrlsForApi, 204 listAcceptedFollowerUrlsForApi,
205 listFollowingUrlsForApi, 205 listAcceptedFollowingUrlsForApi,
206 listFollowingForApi, 206 listFollowingForApi,
207 listFollowersForApi 207 listFollowersForApi
208 ] 208 ]
@@ -365,12 +365,12 @@ listOwned = function () {
365 return Account.findAll(query) 365 return Account.findAll(query)
366} 366}
367 367
368listFollowerUrlsForApi = function (id: number, start: number, count?: number) { 368listAcceptedFollowerUrlsForApi = function (id: number, start: number, count?: number) {
369 return createListFollowForApiQuery('followers', id, start, count) 369 return createListAcceptedFollowForApiQuery('followers', id, start, count)
370} 370}
371 371
372listFollowingUrlsForApi = function (id: number, start: number, count?: number) { 372listAcceptedFollowingUrlsForApi = function (id: number, start: number, count?: number) {
373 return createListFollowForApiQuery('following', id, start, count) 373 return createListAcceptedFollowForApiQuery('following', id, start, count)
374} 374}
375 375
376listFollowingForApi = function (id: number, start: number, count: number, sort: string) { 376listFollowingForApi = function (id: number, start: number, count: number, sort: string) {
@@ -506,7 +506,7 @@ loadAccountByPodAndUUID = function (uuid: string, podId: number, transaction: Se
506 506
507// ------------------------------ UTILS ------------------------------ 507// ------------------------------ UTILS ------------------------------
508 508
509async function createListFollowForApiQuery (type: 'followers' | 'following', id: number, start: number, count?: number) { 509async function createListAcceptedFollowForApiQuery (type: 'followers' | 'following', id: number, start: number, count?: number) {
510 let firstJoin: string 510 let firstJoin: string
511 let secondJoin: string 511 let secondJoin: string
512 512
@@ -525,7 +525,7 @@ async function createListFollowForApiQuery (type: 'followers' | 'following', id:
525 let query = 'SELECT ' + selection + ' FROM "Account" ' + 525 let query = 'SELECT ' + selection + ' FROM "Account" ' +
526 'INNER JOIN "AccountFollower" ON "AccountFollower"."' + firstJoin + '" = "Account"."id" ' + 526 'INNER JOIN "AccountFollower" ON "AccountFollower"."' + firstJoin + '" = "Account"."id" ' +
527 'INNER JOIN "Account" AS "Follows" ON "Followers"."id" = "Follows"."' + secondJoin + '" ' + 527 'INNER JOIN "Account" AS "Follows" ON "Followers"."id" = "Follows"."' + secondJoin + '" ' +
528 'WHERE "Account"."id" = $id ' + 528 'WHERE "Account"."id" = $id AND "AccountFollower"."state" = \'accepted\' ' +
529 'LIMIT ' + start 529 'LIMIT ' + start
530 530
531 if (count !== undefined) query += ', ' + count 531 if (count !== undefined) query += ', ' + count