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 } }, });