fix: move upload_and_replace route decorator to the actual handler

The previous rollback-helper extraction landed the decorator above
_rollback_new_file instead of upload_and_replace_file, which left the
POST /{id}/file/upload_and_replace route pointed at an internal helper
with the wrong signature (no id path param, no UploadFile, no
old_file_id form) and the real handler unexposed. Move the decorator
back to upload_and_replace_file and keep _rollback_new_file as a plain
private helper.
This commit is contained in:
DrMelone 2026-04-13 00:26:43 +02:00
parent 58e86b7b60
commit 624b360eb1

View file

@ -701,7 +701,6 @@ class UploadAndReplaceResponse(BaseModel):
filename: str
@router.post('/{id}/file/upload_and_replace', response_model=UploadAndReplaceResponse)
async def _rollback_new_file(
kb_id: str,
new_file_id: str,
@ -727,6 +726,7 @@ async def _rollback_new_file(
)
@router.post('/{id}/file/upload_and_replace', response_model=UploadAndReplaceResponse)
async def upload_and_replace_file(
request: Request,
id: str,