Skip to content

Commit

Permalink
fix: add creatorId on filter options
Browse files Browse the repository at this point in the history
  • Loading branch information
GloireMutaliko21 committed Nov 13, 2024
1 parent 7c7bc0c commit c5ffa4e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/contracts/src/task.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,5 @@ export interface ITaskDateFilterInput
startDateTo?: Date;
dueDateFrom?: Date;
dueDateTo?: Date;
creatorId?: Date;
}
4 changes: 4 additions & 0 deletions packages/core/src/tasks/task.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,7 @@ export class TaskService extends TenantAwareCrudService<Task> {
startDateTo,
dueDateFrom,
dueDateTo,
creatorId,
organizationId,
employeeId,
projectId,
Expand All @@ -882,6 +883,9 @@ export class TaskService extends TenantAwareCrudService<Task> {
// Add Optional additional filters by
query.andWhere(
new Brackets((web: WhereExpressionBuilder) => {
if (isNotEmpty(creatorId)) {
web.andWhere(p(`"${query.alias}"."creatorId" = :creatorId`), { creatorId });
}
if (isNotEmpty(employeeId)) {
query.leftJoin(`${query.alias}.members`, 'members');
web.andWhere((qb: SelectQueryBuilder<Task>) => {
Expand Down

0 comments on commit c5ffa4e

Please sign in to comment.