Fix My Tickets and queue filter
- 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:
@@ -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' } },
|
||||
|
||||
Reference in New Issue
Block a user