Skip to content

Commit

Permalink
Re-enable auto-issuance
Browse files Browse the repository at this point in the history
  • Loading branch information
robknight committed Dec 2, 2024
1 parent 6935e8a commit 1a83230
Showing 1 changed file with 26 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1203,27 +1203,32 @@ export class PretixPipeline implements BasePipeline {
}
});

// Is this still needed?
// const provider = this.autoIssuanceProvider;
// if (provider) {
// const newManualTickets = (
// await Promise.all(
// emails.map(async (e) =>
// provider.maybeIssueForUser(
// e.email,
// await this.getAllManualTickets(client),
// await this.db.loadByEmail(this.id, e.email)
// )
// )
// )
// ).flat();

// await Promise.allSettled(
// newManualTickets.map((t) =>
// this.manualTicketDB.save(client, this.id, t)
// )
// );
// }
const provider = this.autoIssuanceProvider;
if (provider) {
const allManualTickets = await sqlQueryWithPool(
this.context.dbPool,
async (client) => await this.getAllManualTickets(client)
);
const newManualTickets = (
await Promise.all(
emails.map(async (e) =>
provider.maybeIssueForUser(
e.email,
allManualTickets,
await this.db.loadByEmail(this.id, e.email)
)
)
)
).flat();

await sqlQueryWithPool(this.context.dbPool, async (client) =>
Promise.allSettled(
newManualTickets.map((t) =>
this.manualTicketDB.save(client, this.id, t)
)
)
);
}

const tickets = await sqlQueryWithPool(
this.context.dbPool,
Expand Down

0 comments on commit 1a83230

Please sign in to comment.