Add method to search by parent_id.
This commit is contained in:
parent
a4a09380b6
commit
95826cde40
@ -80,6 +80,16 @@ class TasksService {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async getByParent(id: NonNullable<Task["id"]>) {
|
||||||
|
logger.info(`Searching for records with parent '${id}'.`);
|
||||||
|
return this._executeQuery(() =>
|
||||||
|
this.db.query.tasks.findMany({
|
||||||
|
with: { type: true },
|
||||||
|
where: (tasks, { eq }) => eq(tasks.parent, id),
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default TasksService;
|
export default TasksService;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user