all repos — stealth-developers @ 150c6916c5949d48883c1e2f51b092b07fb0669c

db: getTicketByUser command
vi did:web:vt3e.cat
Fri, 26 Jun 2026 10:56:41 +0100
commit

150c6916c5949d48883c1e2f51b092b07fb0669c

parent

212c942ae395a7b4812d0ad897c3d128b2260413

1 files changed, 13 insertions(+), 0 deletions(-)

jump to
M pkgs/db/src/utils/ticket.tspkgs/db/src/utils/ticket.ts

@@ -113,6 +113,19 @@ with: ticketWithRelations,

}); } +export async function getTicketByUser( + userId: number, + ticketNumber: number, +): Promise<TicketWithRelations | undefined> { + return await db.query.tickets.findFirst({ + where: { + openedBy: userId, + localId: ticketNumber, + }, + with: ticketWithRelations, + }); +} + export async function getTicketByChannelId( channelId: string, ): Promise<TicketWithRelations | undefined> {