Merge pull request #491 from lazmo88/fix/parentid-filter-issues-list
fix: wire parentId query filter into issues list endpoint
This commit is contained in:
@@ -222,6 +222,7 @@ export function issueRoutes(db: Db, storage: StorageService) {
|
|||||||
touchedByUserId,
|
touchedByUserId,
|
||||||
unreadForUserId,
|
unreadForUserId,
|
||||||
projectId: req.query.projectId as string | undefined,
|
projectId: req.query.projectId as string | undefined,
|
||||||
|
parentId: req.query.parentId as string | undefined,
|
||||||
labelId: req.query.labelId as string | undefined,
|
labelId: req.query.labelId as string | undefined,
|
||||||
q: req.query.q as string | undefined,
|
q: req.query.q as string | undefined,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ export interface IssueFilters {
|
|||||||
touchedByUserId?: string;
|
touchedByUserId?: string;
|
||||||
unreadForUserId?: string;
|
unreadForUserId?: string;
|
||||||
projectId?: string;
|
projectId?: string;
|
||||||
|
parentId?: string;
|
||||||
labelId?: string;
|
labelId?: string;
|
||||||
q?: string;
|
q?: string;
|
||||||
}
|
}
|
||||||
@@ -458,6 +459,7 @@ export function issueService(db: Db) {
|
|||||||
conditions.push(unreadForUserCondition(companyId, unreadForUserId));
|
conditions.push(unreadForUserCondition(companyId, unreadForUserId));
|
||||||
}
|
}
|
||||||
if (filters?.projectId) conditions.push(eq(issues.projectId, filters.projectId));
|
if (filters?.projectId) conditions.push(eq(issues.projectId, filters.projectId));
|
||||||
|
if (filters?.parentId) conditions.push(eq(issues.parentId, filters.parentId));
|
||||||
if (filters?.labelId) {
|
if (filters?.labelId) {
|
||||||
const labeledIssueIds = await db
|
const labeledIssueIds = await db
|
||||||
.select({ issueId: issueLabels.issueId })
|
.select({ issueId: issueLabels.issueId })
|
||||||
|
|||||||
Reference in New Issue
Block a user