Add authentification
This commit is contained in:
@@ -3,9 +3,12 @@ import src.models as models
|
||||
|
||||
def get_all(
|
||||
session: Session,
|
||||
forms: list[str]
|
||||
forms: list[str] = [],
|
||||
form_id: int | None = None,
|
||||
) -> list[models.ContractPublic]:
|
||||
statement = select(models.Contract)
|
||||
if form_id:
|
||||
statement = statement.join(models.Form).where(models.Form.id == form_id)
|
||||
if len(forms) > 0:
|
||||
statement = statement.join(models.Form).where(models.Form.name.in_(forms))
|
||||
return session.exec(statement.order_by(models.Contract.id)).all()
|
||||
|
||||
Reference in New Issue
Block a user