use Array.map instead of for const of

This commit is contained in:
tamaina 2023-04-20 16:45:28 +00:00
parent b0d640f642
commit ccfbc89047

View file

@ -146,10 +146,10 @@ export class AccountMoveService {
followerHost: IsNull(), // follower is local followerHost: IsNull(), // follower is local
followerId: proxy ? Not(proxy.id) : undefined, followerId: proxy ? Not(proxy.id) : undefined,
}); });
const followJobs: RelationshipJobData[] = []; const followJobs = followings.map(following => ({
for (const following of followings) { from: { id: following.followerId },
followJobs.push({ from: { id: following.followerId }, to: { id: dst.id } }); to: { id: dst.id },
} })) as RelationshipJobData[];
// Decrease following count instead of unfollowing. // Decrease following count instead of unfollowing.
try { try {