X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Faccount%2Faccount-follow.ts;h=724f37baa6b6038815611ab1d8f5cf652f70e8b0;hb=25ed141c7c7631ef21d8764c1163fbf8a6591391;hp=8e35c7d207fde9e800a1c0838016cde5bfa02ccf;hpb=0032ebe94aa83fab761c7de3ceb6210ac4532824;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/account/account-follow.ts b/server/models/account/account-follow.ts index 8e35c7d20..724f37baa 100644 --- a/server/models/account/account-follow.ts +++ b/server/models/account/account-follow.ts @@ -181,16 +181,16 @@ listFollowersForApi = function (id: number, start: number, count: number, sort: }) } -listAcceptedFollowerUrlsForApi = function (accountIds: number[], start?: number, count?: number) { - return createListAcceptedFollowForApiQuery('followers', accountIds, start, count) +listAcceptedFollowerUrlsForApi = function (accountIds: number[], t: Sequelize.Transaction, start?: number, count?: number) { + return createListAcceptedFollowForApiQuery('followers', accountIds, t, start, count) } -listAcceptedFollowerSharedInboxUrls = function (accountIds: number[]) { - return createListAcceptedFollowForApiQuery('followers', accountIds, undefined, undefined, 'sharedInboxUrl') +listAcceptedFollowerSharedInboxUrls = function (accountIds: number[], t: Sequelize.Transaction) { + return createListAcceptedFollowForApiQuery('followers', accountIds, t, undefined, undefined, 'sharedInboxUrl') } -listAcceptedFollowingUrlsForApi = function (accountIds: number[], start?: number, count?: number) { - return createListAcceptedFollowForApiQuery('following', accountIds, start, count) +listAcceptedFollowingUrlsForApi = function (accountIds: number[], t: Sequelize.Transaction, start?: number, count?: number) { + return createListAcceptedFollowForApiQuery('following', accountIds, t, start, count) } // ------------------------------ UTILS ------------------------------ @@ -198,6 +198,7 @@ listAcceptedFollowingUrlsForApi = function (accountIds: number[], start?: number async function createListAcceptedFollowForApiQuery ( type: 'followers' | 'following', accountIds: number[], + t: Sequelize.Transaction, start?: number, count?: number, columnUrl = 'url' @@ -227,7 +228,8 @@ async function createListAcceptedFollowForApiQuery ( const options = { bind: { accountIds }, - type: Sequelize.QueryTypes.SELECT + type: Sequelize.QueryTypes.SELECT, + transaction: t } tasks.push(AccountFollow['sequelize'].query(query, options)) }