Add method to search by parent_id.

This commit is contained in:
themodrnhakr 2025-09-29 21:13:26 -05:00
parent a4a09380b6
commit 95826cde40

View File

@ -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;