fix: param order in gitea routes (request first)
This commit is contained in:
@@ -43,7 +43,7 @@ async def list_projects(request: Request, org: str = ""):
|
|||||||
|
|
||||||
# ── Repo tree ──
|
# ── Repo tree ──
|
||||||
@router.get("/projects/{owner}/{repo}/tree")
|
@router.get("/projects/{owner}/{repo}/tree")
|
||||||
async def repo_tree(owner: str, repo: str, path: str = "", request: Request):
|
async def repo_tree(request: Request, owner: str, repo: str, path: str = ""):
|
||||||
"""Get contents of a repo directory (one level)."""
|
"""Get contents of a repo directory (one level)."""
|
||||||
gitea = _require_gitea(request)
|
gitea = _require_gitea(request)
|
||||||
try:
|
try:
|
||||||
@@ -64,7 +64,7 @@ async def repo_tree(owner: str, repo: str, path: str = "", request: Request):
|
|||||||
|
|
||||||
# ── File content ──
|
# ── File content ──
|
||||||
@router.get("/projects/{owner}/{repo}/file")
|
@router.get("/projects/{owner}/{repo}/file")
|
||||||
async def get_file(owner: str, repo: str, path: str, request: Request):
|
async def get_file(request: Request, owner: str, repo: str, path: str):
|
||||||
"""Get file content (decoded)."""
|
"""Get file content (decoded)."""
|
||||||
gitea = _require_gitea(request)
|
gitea = _require_gitea(request)
|
||||||
try:
|
try:
|
||||||
@@ -76,7 +76,7 @@ async def get_file(owner: str, repo: str, path: str, request: Request):
|
|||||||
|
|
||||||
# ── Save file (create or update) ──
|
# ── Save file (create or update) ──
|
||||||
@router.put("/projects/{owner}/{repo}/file")
|
@router.put("/projects/{owner}/{repo}/file")
|
||||||
async def save_file(owner: str, repo: str, request: Request):
|
async def save_file(request: Request, owner: str, repo: str):
|
||||||
"""Create or update a file in the repo."""
|
"""Create or update a file in the repo."""
|
||||||
import json
|
import json
|
||||||
gitea = _require_gitea(request)
|
gitea = _require_gitea(request)
|
||||||
@@ -99,7 +99,7 @@ async def save_file(owner: str, repo: str, request: Request):
|
|||||||
|
|
||||||
# ── Delete file ──
|
# ── Delete file ──
|
||||||
@router.delete("/projects/{owner}/{repo}/file")
|
@router.delete("/projects/{owner}/{repo}/file")
|
||||||
async def delete_file(owner: str, repo: str, request: Request):
|
async def delete_file(request: Request, owner: str, repo: str):
|
||||||
"""Delete a file from the repo."""
|
"""Delete a file from the repo."""
|
||||||
import json
|
import json
|
||||||
gitea = _require_gitea(request)
|
gitea = _require_gitea(request)
|
||||||
@@ -117,7 +117,7 @@ async def delete_file(owner: str, repo: str, request: Request):
|
|||||||
|
|
||||||
# ── Labels ──
|
# ── Labels ──
|
||||||
@router.get("/projects/{owner}/{repo}/labels")
|
@router.get("/projects/{owner}/{repo}/labels")
|
||||||
async def get_labels(owner: str, repo: str, request: Request):
|
async def get_labels(request: Request, owner: str, repo: str):
|
||||||
"""Get labels for a repo (mapped to tags)."""
|
"""Get labels for a repo (mapped to tags)."""
|
||||||
gitea = _require_gitea(request)
|
gitea = _require_gitea(request)
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user