summaryrefslogtreecommitdiff
path: root/packages/backend/src
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2025-03-25 08:05:59 +0900
committersyuilo <4439005+syuilo@users.noreply.github.com>2025-03-25 08:05:59 +0900
commit8da1368a0b1be76dcf128e486f197f4a0654f941 (patch)
tree823d8227b5da2ca60981f685a1e810ae1eefdeaf /packages/backend/src
parentfix(frontend): 本番環境で不必要なconsole.logを出さないように... (diff)
downloadsharkey-8da1368a0b1be76dcf128e486f197f4a0654f941.tar.gz
sharkey-8da1368a0b1be76dcf128e486f197f4a0654f941.tar.bz2
sharkey-8da1368a0b1be76dcf128e486f197f4a0654f941.zip
fix(backend): 既存のルームメンバーを改めて招待できないように
Diffstat (limited to 'packages/backend/src')
-rw-r--r--packages/backend/src/core/ChatService.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/backend/src/core/ChatService.ts b/packages/backend/src/core/ChatService.ts
index eece5d0da3..57e33af107 100644
--- a/packages/backend/src/core/ChatService.ts
+++ b/packages/backend/src/core/ChatService.ts
@@ -518,6 +518,10 @@ export class ChatService {
const room = await this.chatRoomsRepository.findOneByOrFail({ id: roomId, ownerId: inviterId });
+ if (await this.isRoomMember(room, inviteeId)) {
+ throw new Error('already member');
+ }
+
const existingInvitation = await this.chatRoomInvitationsRepository.findOneBy({ roomId, userId: inviteeId });
if (existingInvitation) {
throw new Error('already invited');