fix: ruff lint + format fixes in tests, ESLint fixes in frontend

This commit is contained in:
2026-07-17 21:28:58 +02:00
parent 341d0c6f38
commit fbb1b39b57
56 changed files with 1399 additions and 721 deletions
+3 -9
View File
@@ -137,24 +137,18 @@ async def list_contacts(
return contacts, total
async def get_contact_by_id(
db: AsyncSession, contact_id: uuid.UUID
) -> Contact | None:
async def get_contact_by_id(db: AsyncSession, contact_id: uuid.UUID) -> Contact | None:
"""Get a single contact by ID, excluding soft-deleted. Eager-loads contact persons."""
stmt = (
select(Contact)
.options(selectinload(Contact.contact_persons))
.where(
and_(Contact.id == contact_id, Contact.deleted_at.is_(None))
)
.where(and_(Contact.id == contact_id, Contact.deleted_at.is_(None)))
)
result = await db.execute(stmt)
return result.scalar_one_or_none()
async def create_contact(
db: AsyncSession, data: dict[str, Any]
) -> Contact:
async def create_contact(db: AsyncSession, data: dict[str, Any]) -> Contact:
"""Create a new contact with optional nested contact persons.
The data dict may contain a 'contact_persons' list of dicts.