Skip to content

Commit

Permalink
fix broken ticket quantity pooling: Wrong events' capacity were being…
Browse files Browse the repository at this point in the history
… incremented and decremented from the remaining ticket capacity
  • Loading branch information
Ratchet7x5 committed Jan 13, 2025
1 parent 466bec5 commit 5fb25bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/gateway/eventsGateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export async function reserveTicket(priceId: string) {
.set({
eventCapacityRemaining: sql`${events.eventCapacityRemaining} - 1`,
})
.where(eq(events.id, eventId[0].id))
.where(eq(events.id, eventId[0].eventId!))
.returning();
}

Expand Down Expand Up @@ -137,7 +137,7 @@ export async function releaseReservedTicket(priceId: string) {
.set({
eventCapacityRemaining: sql`${events.eventCapacityRemaining} + 1`,
})
.where(eq(events.id, eventId[0].id))
.where(eq(events.id, eventId[0].eventId!))
.returning();

return releasedTicket;
Expand Down

0 comments on commit 5fb25bf

Please sign in to comment.