From aac4c5b34b833b3bf463d20091c903c645de533c Mon Sep 17 00:00:00 2001 From: Mir Arif Hasan Date: Tue, 2 Sep 2025 13:49:53 +0600 Subject: [PATCH] fix: `orderIndex` update to scope by collection ID (#5365) --- .../src/team-request/team-request.service.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/hoppscotch-backend/src/team-request/team-request.service.ts b/packages/hoppscotch-backend/src/team-request/team-request.service.ts index 1c80d457..c2259fd7 100644 --- a/packages/hoppscotch-backend/src/team-request/team-request.service.ts +++ b/packages/hoppscotch-backend/src/team-request/team-request.service.ts @@ -119,7 +119,10 @@ export class TeamRequestService { await this.prisma.lockTableExclusive(tx, 'TeamRequest'); await tx.teamRequest.updateMany({ - where: { orderIndex: { gte: dbTeamReq.orderIndex } }, + where: { + collectionID: dbTeamReq.collectionID, + orderIndex: { gte: dbTeamReq.orderIndex }, + }, data: { orderIndex: { decrement: 1 } }, });