- return retryTransactionWrapper(follow, options)
-}
-
-async function follow (account: AccountModel, targetAccountURL: string) {
- await sequelizeTypescript.transaction(async t => {
- const targetAccount = await AccountModel.loadByUrl(targetAccountURL, t)
-
- if (!targetAccount) throw new Error('Unknown account')
- if (targetAccount.isOwned() === false) throw new Error('This is not a local account.')
+ if (!targetActor) throw new Error('Unknown actor')
+ if (targetActor.isOwned() === false) throw new Error('This is not a local actor.')