From 18380f8e01d1432c9c7cd9000b2f72b67f010f60 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Thu, 24 Oct 2024 20:29:52 +0900 Subject: [PATCH] refactor --- .../src/server/api/endpoints/charts/user/following.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/charts/user/following.ts b/packages/backend/src/server/api/endpoints/charts/user/following.ts index 711a2fd082..15b318fa89 100644 --- a/packages/backend/src/server/api/endpoints/charts/user/following.ts +++ b/packages/backend/src/server/api/endpoints/charts/user/following.ts @@ -60,16 +60,13 @@ export default class extends Endpoint { // eslint- done(); } - const iAmModerator = await this.roleService.isModerator(me); - - if (iAmModerator) { + if (me != null && me.id === ps.userId) { done(); } - if ( - (profile.followingVisibility === 'private' || profile.followersVisibility === 'private') && - (me != null && profile.userId === me.id) - ) { + const iAmModerator = await this.roleService.isModerator(me); + + if (iAmModerator) { done(); }