diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-11-10 17:27:49 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-11-27 19:40:51 +0100 |
commit | 571389d43b8fc8aaf27e77c06f19b320b08dbbc9 (patch) | |
tree | e57173bcd0590d939c28952a29258fd02a281e35 /server/models/account/account.ts | |
parent | 38fa2065831b5f55be0d7f30f19a62c967397208 (diff) | |
download | PeerTube-571389d43b8fc8aaf27e77c06f19b320b08dbbc9.tar.gz PeerTube-571389d43b8fc8aaf27e77c06f19b320b08dbbc9.tar.zst PeerTube-571389d43b8fc8aaf27e77c06f19b320b08dbbc9.zip |
Make it compile at least
Diffstat (limited to 'server/models/account/account.ts')
-rw-r--r-- | server/models/account/account.ts | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/server/models/account/account.ts b/server/models/account/account.ts index 00c0aefd4..a79e13880 100644 --- a/server/models/account/account.ts +++ b/server/models/account/account.ts | |||
@@ -268,14 +268,15 @@ function afterDestroy (account: AccountInstance) { | |||
268 | uuid: account.uuid | 268 | uuid: account.uuid |
269 | } | 269 | } |
270 | 270 | ||
271 | return removeVideoAccountToFriends(removeVideoAccountToFriendsParams) | 271 | // FIXME: remove account in followers |
272 | // return removeVideoAccountToFriends(removeVideoAccountToFriendsParams) | ||
272 | } | 273 | } |
273 | 274 | ||
274 | return undefined | 275 | return undefined |
275 | } | 276 | } |
276 | 277 | ||
277 | toActivityPubObject = function (this: AccountInstance) { | 278 | toActivityPubObject = function (this: AccountInstance) { |
278 | const type = this.podId ? 'Application' : 'Person' | 279 | const type = this.podId ? 'Application' as 'Application' : 'Person' as 'Person' |
279 | 280 | ||
280 | const json = { | 281 | const json = { |
281 | type, | 282 | type, |
@@ -346,11 +347,11 @@ listOwned = function () { | |||
346 | return Account.findAll(query) | 347 | return Account.findAll(query) |
347 | } | 348 | } |
348 | 349 | ||
349 | listFollowerUrlsForApi = function (name: string, start: number, count: number) { | 350 | listFollowerUrlsForApi = function (name: string, start: number, count?: number) { |
350 | return createListFollowForApiQuery('followers', name, start, count) | 351 | return createListFollowForApiQuery('followers', name, start, count) |
351 | } | 352 | } |
352 | 353 | ||
353 | listFollowingUrlsForApi = function (name: string, start: number, count: number) { | 354 | listFollowingUrlsForApi = function (name: string, start: number, count?: number) { |
354 | return createListFollowForApiQuery('following', name, start, count) | 355 | return createListFollowForApiQuery('following', name, start, count) |
355 | } | 356 | } |
356 | 357 | ||
@@ -405,7 +406,7 @@ loadAccountByPodAndUUID = function (uuid: string, podId: number, transaction: Se | |||
405 | 406 | ||
406 | // ------------------------------ UTILS ------------------------------ | 407 | // ------------------------------ UTILS ------------------------------ |
407 | 408 | ||
408 | async function createListFollowForApiQuery (type: 'followers' | 'following', name: string, start: number, count: number) { | 409 | async function createListFollowForApiQuery (type: 'followers' | 'following', name: string, start: number, count?: number) { |
409 | let firstJoin: string | 410 | let firstJoin: string |
410 | let secondJoin: string | 411 | let secondJoin: string |
411 | 412 | ||
@@ -421,11 +422,13 @@ async function createListFollowForApiQuery (type: 'followers' | 'following', nam | |||
421 | const tasks: Promise<any>[] = [] | 422 | const tasks: Promise<any>[] = [] |
422 | 423 | ||
423 | for (const selection of selections) { | 424 | for (const selection of selections) { |
424 | const query = 'SELECT ' + selection + ' FROM "Account" ' + | 425 | let query = 'SELECT ' + selection + ' FROM "Account" ' + |
425 | 'INNER JOIN "AccountFollower" ON "AccountFollower"."' + firstJoin + '" = "Account"."id" ' + | 426 | 'INNER JOIN "AccountFollower" ON "AccountFollower"."' + firstJoin + '" = "Account"."id" ' + |
426 | 'INNER JOIN "Account" AS "Followers" ON "Followers"."id" = "AccountFollower"."' + secondJoin + '" ' + | 427 | 'INNER JOIN "Account" AS "Followers" ON "Followers"."id" = "AccountFollower"."' + secondJoin + '" ' + |
427 | 'WHERE "Account"."name" = \'$name\' ' + | 428 | 'WHERE "Account"."name" = \'$name\' ' + |
428 | 'LIMIT ' + start + ', ' + count | 429 | 'LIMIT ' + start |
430 | |||
431 | if (count !== undefined) query += ', ' + count | ||
429 | 432 | ||
430 | const options = { | 433 | const options = { |
431 | bind: { name }, | 434 | bind: { name }, |