feat: return scrip results on ticket create, update frontend types
- POST /tickets now returns { ticket, scrip_results } matching PATCH pattern
- createTicket API function returns UpdateResult instead of Ticket
- Update call site to use data.ticket.id
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -231,9 +231,9 @@ export function createTicketsRouter(db: Db): Hono {
|
||||
|
||||
const createdTransactions = await db.insert(transactions).values(txList as any).returning();
|
||||
const prepared = await scripEngine.prepare(ticket.id, createdTransactions as any);
|
||||
await scripEngine.commit(prepared);
|
||||
const results = await scripEngine.commit(prepared);
|
||||
|
||||
return c.json(ticket, 201);
|
||||
return c.json({ ticket, scrip_results: results }, 201);
|
||||
});
|
||||
|
||||
// GET /:id — get ticket with custom field values
|
||||
|
||||
Reference in New Issue
Block a user