Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

fix: `orderIndex` update to scope by collection ID (#5365)

Mir Arif Hasanaac4c5b34b83
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 1c80d4572..c2259fd77 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 } },
});