Skip to content
Merged
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
14 changes: 8 additions & 6 deletions backend/apps/api/rest/v0/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
from apps.owasp.models.project import Project as ProjectModel
from apps.owasp.models.snapshot import Snapshot as SnapshotModel

ORDERING_FIELD_DESCRIPTION = "Ordering field"

router = RouterPaginated(tags=["Community"])


Expand Down Expand Up @@ -114,7 +116,7 @@ def list_snapshots(
]
| None = Query(
None,
description="Ordering field",
description=ORDERING_FIELD_DESCRIPTION,
),
) -> list[Snapshot]:
"""Get all snapshots."""
Expand Down Expand Up @@ -160,7 +162,7 @@ def list_snapshot_chapters(
snapshot_id: str = Path(example="2025-02"),
ordering: Literal["created_at", "-created_at", "updated_at", "-updated_at"] | None = Query(
None,
description="Ordering field",
description=ORDERING_FIELD_DESCRIPTION,
),
) -> list[Chapter]:
"""Get new chapters in snapshot."""
Expand All @@ -185,7 +187,7 @@ def list_snapshot_issues(
snapshot_id: str = Path(example="2025-02"),
ordering: Literal["created_at", "-created_at", "updated_at", "-updated_at"] | None = Query(
None,
description="Ordering field",
description=ORDERING_FIELD_DESCRIPTION,
),
) -> list[SnapshotIssue]:
"""Get new issues in snapshot."""
Expand All @@ -212,7 +214,7 @@ def list_snapshot_members(
snapshot_id: str = Path(example="2025-02"),
ordering: Literal["created_at", "-created_at", "updated_at", "-updated_at"] | None = Query(
None,
description="Ordering field",
description=ORDERING_FIELD_DESCRIPTION,
),
) -> list[Member]:
"""Get new members in snapshot."""
Expand All @@ -237,7 +239,7 @@ def list_snapshot_projects(
snapshot_id: str = Path(example="2025-02"),
ordering: Literal["created_at", "-created_at", "updated_at", "-updated_at"] | None = Query(
None,
description="Ordering field",
description=ORDERING_FIELD_DESCRIPTION,
),
) -> list[Project]:
"""Get new projects in snapshot."""
Expand All @@ -262,7 +264,7 @@ def list_snapshot_releases(
snapshot_id: str = Path(example="2025-02"),
ordering: Literal["created_at", "-created_at", "published_at", "-published_at"] | None = Query(
None,
description="Ordering field",
description=ORDERING_FIELD_DESCRIPTION,
),
) -> list[SnapshotRelease]:
"""Get new releases in snapshot."""
Expand Down