なんか

This commit is contained in:
syuilo 2020-02-15 09:10:49 +09:00
parent c32a5d602b
commit ccea1755fc
3 changed files with 11 additions and 6 deletions

View file

@ -125,6 +125,14 @@ export class UserRepository extends Repository<User> {
return count > 0;
}
public async getHasPendingReceivedFollowRequest(userId: User['id']): Promise<boolean> {
const count = await FollowRequests.count({
followeeId: userId
});
return count > 0;
}
public async pack(
src: User['id'] | User,
me?: User['id'] | User | null | undefined,
@ -226,9 +234,7 @@ export class UserRepository extends Repository<User> {
hasUnreadAntenna: this.getHasUnreadAntenna(user.id),
hasUnreadMessagingMessage: this.getHasUnreadMessagingMessage(user.id),
hasUnreadNotification: this.getHasUnreadNotification(user.id),
pendingReceivedFollowRequestsCount: FollowRequests.count({
followeeId: user.id
}),
hasPendingReceivedFollowRequest: this.getHasPendingReceivedFollowRequest(user.id),
integrations: profile!.integrations,
} : {}),