feat: unify scope settings and catalog table interactions
Deploy production / deploy (push) Successful in 54s

This commit is contained in:
yuxuanhui
2026-09-12 12:11:53 +08:00
parent 9dee2de039
commit 8981c24fda
29 changed files with 2521 additions and 796 deletions
+4 -2
View File
@@ -1,6 +1,6 @@
"""Authenticated preparation and field-directory endpoints."""
from typing import Annotated
from typing import Annotated, Literal
from fastapi import APIRouter, Depends, HTTPException, Query, Request
from sqlalchemy import delete, select
@@ -55,9 +55,11 @@ async def preparations(
scope_key: str | None = None,
limit: int = Query(25, ge=1, le=100),
offset: int = Query(0, ge=0),
sort: Literal["name", "created_at", "updated_at"] = "updated_at",
direction: Literal["asc", "desc"] = "desc",
):
async with request.app.state.sessions() as db:
return await Preparations(db).list(q, scope_key, limit, offset)
return await Preparations(db).list(q, scope_key, limit, offset, sort, direction)
@router.post("/data-preparations", status_code=201)