Skip to content
This repository was archived by the owner on Oct 11, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/api/src/gw2analytics_api/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,9 @@ def get_session() -> Iterator[Session]:
session = get_sessionmaker()()
try:
yield session
session.commit()
except BaseException:
session.rollback()
raise
finally:
session.close()
6 changes: 5 additions & 1 deletion apps/api/src/gw2analytics_api/routes/fights/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,11 @@ def list_fights(
"""
rows = (
db.execute(
select(OrmFight).order_by(OrmFight.started_at.desc()).limit(limit).offset(offset),
select(OrmFight)
.options(selectinload(OrmFight.agents), selectinload(OrmFight.skills))
.order_by(OrmFight.started_at.desc())
.limit(limit)
.offset(offset),
)
.scalars()
.all()
Expand Down
7 changes: 6 additions & 1 deletion apps/api/src/gw2analytics_api/routes/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,17 @@ def create_webhook(
@limiter.limit("30/minute")
def list_webhooks(
request: Request, # noqa: ARG001
limit: int = Query(100, ge=1, le=1000),
offset: int = Query(0, ge=0),
db: Session = Depends(get_session), # noqa: B008
) -> list[WebhookSubscriptionOut]:
"""List active (non-revoked) webhook subscriptions. Secrets never returned."""
rows = (
db.execute(
select(OrmWebhookSubscription).where(OrmWebhookSubscription.revoked_at.is_(None))
select(OrmWebhookSubscription)
.where(OrmWebhookSubscription.revoked_at.is_(None))
.limit(limit)
.offset(offset),
)
.scalars()
.all()
Expand Down
14 changes: 13 additions & 1 deletion web/src/lib/api/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2897,7 +2897,10 @@ export interface operations {
};
list_webhooks_api_v1_webhooks_get: {
parameters: {
query?: never;
query?: {
limit?: number;
offset?: number;
};
header?: never;
path?: never;
cookie?: never;
Expand All @@ -2913,6 +2916,15 @@ export interface operations {
"application/json": components["schemas"]["WebhookSubscriptionOut"][];
};
};
/** @description Validation Error */
422: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["HTTPValidationError"];
};
};
};
};
create_webhook_api_v1_webhooks_post: {
Expand Down
Loading