From cc420c245f26cb574bcbee28553512d4eaf40920 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 24 Jan 2024 09:41:22 +0900 Subject: [PATCH] =?UTF-8?q?enhance(reversi):=20=E6=BA=96=E5=82=99=E4=B8=AD?= =?UTF-8?q?=E3=81=AE=E8=87=AA=E5=88=86=E3=81=AE=E5=AF=BE=E5=B1=80=E3=82=82?= =?UTF-8?q?=E4=B8=80=E8=A6=A7=E3=81=AB=E8=A1=A8=E7=A4=BA=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/server/api/endpoints/reversi/games.ts | 3 ++- packages/frontend/src/pages/reversi/index.vue | 20 +++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/reversi/games.ts b/packages/backend/src/server/api/endpoints/reversi/games.ts index f28fe5d987..c1b2ff1702 100644 --- a/packages/backend/src/server/api/endpoints/reversi/games.ts +++ b/packages/backend/src/server/api/endpoints/reversi/games.ts @@ -43,7 +43,6 @@ export default class extends Endpoint { // eslint- ) { super(meta, paramDef, async (ps, me) => { const query = this.queryService.makePaginationQuery(this.reversiGamesRepository.createQueryBuilder('game'), ps.sinceId, ps.untilId) - .andWhere('game.isStarted = TRUE') .innerJoinAndSelect('game.user1', 'user1') .innerJoinAndSelect('game.user2', 'user2'); @@ -53,6 +52,8 @@ export default class extends Endpoint { // eslint- .where('game.user1Id = :userId', { userId: me.id }) .orWhere('game.user2Id = :userId', { userId: me.id }); })); + } else { + query.andWhere('game.isStarted = TRUE'); } const games = await query.take(ps.limit).getMany(); diff --git a/packages/frontend/src/pages/reversi/index.vue b/packages/frontend/src/pages/reversi/index.vue index 523418c99b..4c6c99ae51 100644 --- a/packages/frontend/src/pages/reversi/index.vue +++ b/packages/frontend/src/pages/reversi/index.vue @@ -34,7 +34,7 @@ SPDX-License-Identifier: AGPL-3.0-only