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

This commit is contained in:
Mir Arif Hasan 2025-09-02 13:49:53 +06:00 committed by GitHub
parent bc2e5eb0bb
commit aac4c5b34b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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