This commit is contained in:
Timothy J. Baek
2024-10-02 20:42:10 -07:00
parent 1a26e67611
commit a2eadb30f5
7 changed files with 187 additions and 29 deletions

View File

@@ -106,6 +106,13 @@ class FilesTable:
with get_db() as db:
return [FileModel.model_validate(file) for file in db.query(File).all()]
def get_files_by_ids(self, ids: list[str]) -> list[FileModel]:
with get_db() as db:
return [
FileModel.model_validate(file)
for file in db.query(File).filter(File.id.in_(ids)).all()
]
def get_files_by_user_id(self, user_id: str) -> list[FileModel]:
with get_db() as db:
return [