Skip to content

Commit

Permalink
fix: groupがない場合エラーになる問題を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
nacika-ins committed Mar 29, 2024
1 parent 4e9c2e8 commit 16d8f11
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
}).then(xs => xs.map(x => x.userGroupId));

// グループから最新のメッセージを一つずつ取得 (ミュートを除外)
const groupMessages = await this
const groupMessages = groupIds.length ? await this
.messagingMessagesRepository
.createQueryBuilder('root')
.where(qb => {
Expand All @@ -82,7 +82,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
qb.andWhere('root.userId NOT IN (:...block)', { block: blockeeIds });
}
})
.setParameters({ groupIds: groupIds, mute: muteeIds, block: blockeeIds }).getMany();
.setParameters({ groupIds: groupIds, mute: muteeIds, block: blockeeIds }).getMany() : [];

// ユーザー一覧から最新のメッセージを一つずつ取得
const userMessages = await this
Expand Down

0 comments on commit 16d8f11

Please sign in to comment.