Fix My Tickets and queue filter
All checks were successful
Build & Push / Build Server (push) Successful in 58s
Build & Push / Build Client (push) Successful in 41s

- My Tickets: exclude RESOLVED and CLOSED, show active tickets only
- Queue filter: cascading Category > Type > Item picker — each leaf is
  a distinct queue (e.g. TheWrightServer > Automation > Backup vs Sync)
- Server: support typeId and itemId as ticket list filter params

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-30 23:35:33 -04:00
parent 725f91578d
commit d751e36ae8
3 changed files with 190 additions and 28 deletions

View File

@@ -67,13 +67,15 @@ router.use('/:ticketId/comments', commentRouter)
// GET /api/tickets
router.get('/', async (req: AuthRequest, res) => {
const { status, severity, assigneeId, categoryId, search } = req.query
const { status, severity, assigneeId, categoryId, typeId, itemId, search } = req.query
const where: Record<string, unknown> = {}
if (status) where.status = status
if (severity) where.severity = Number(severity)
if (assigneeId) where.assigneeId = assigneeId
if (categoryId) where.categoryId = categoryId
if (itemId) where.itemId = itemId
else if (typeId) where.typeId = typeId
else if (categoryId) where.categoryId = categoryId
if (search) {
where.OR = [
{ title: { contains: search as string, mode: 'insensitive' } },