refactor: Rename 'mount_path' to 'path' in adapter schemas and related components

This commit is contained in:
shiyu
2025-08-28 17:00:12 +08:00
parent b3b5ae2eac
commit 86e81bf40c
5 changed files with 17 additions and 27 deletions

View File

@@ -39,7 +39,7 @@ async def create_adapter(
data: AdapterCreate,
current_user: Annotated[User, Depends(get_current_active_user)]
):
norm_path = AdapterCreate.normalize_mount_path(data.mount_path)
norm_path = AdapterCreate.normalize_mount_path(data.path)
exists = await StorageAdapter.get_or_none(path=norm_path)
if exists:
raise HTTPException(400, detail="Mount path already exists")
@@ -108,7 +108,7 @@ async def update_adapter(
if not rec:
raise HTTPException(404, detail="Not found")
norm_path = AdapterCreate.normalize_mount_path(data.mount_path)
norm_path = AdapterCreate.normalize_mount_path(data.path)
existing = await StorageAdapter.get_or_none(path=norm_path)
if existing and existing.id != adapter_id:
raise HTTPException(400, detail="Mount path already exists")