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
followerId: proxy ? Not(proxy.id) : undefined,
});
const followJobs: RelationshipJobData[] = [];
for (const following of followings) {
followJobs.push({ from: { id: following.followerId }, to: { id: dst.id } });
}
const followJobs = followings.map(following => ({
from: { id: following.followerId },
to: { id: dst.id },
})) as RelationshipJobData[];
// Decrease following count instead of unfollowing.
try {