|
11 | 11 | from fastapi.exceptions import RequestValidationError, StarletteHTTPException |
12 | 12 |
|
13 | 13 | from fileglancer_central import database as db |
14 | | -from fileglancer_central.model import FileSharePath, FileSharePathResponse, Ticket, ProxiedPath |
| 14 | +from fileglancer_central.model import FileSharePath, FileSharePathResponse, Ticket, ProxiedPath, ProxiedPathResponse |
15 | 15 | from fileglancer_central.settings import get_settings |
16 | 16 | from fileglancer_central.wiki import get_wiki_table, convert_table_to_file_share_paths |
17 | 17 | from fileglancer_central.issues import create_jira_ticket, get_jira_ticket_details, delete_jira_ticket |
@@ -247,11 +247,18 @@ async def create_proxied_path(username: str = Path(..., description="The usernam |
247 | 247 | ) |
248 | 248 |
|
249 | 249 |
|
250 | | - @app.get("/proxied-path/{username}", response_model=List[ProxiedPath], |
| 250 | + @app.get("/proxied-path/{username}", response_model=ProxiedPathResponse, |
251 | 251 | description="Retrieve all proxied paths for a user") |
252 | 252 | async def get_proxied_paths(username: str = Path(..., description="The username of the user who owns the proxied paths")): |
253 | 253 | with db.get_db_session() as session: |
254 | | - return db.get_all_proxied_paths(session, username) |
| 254 | + db_proxied_paths = db.get_all_proxied_paths(session, username) |
| 255 | + proxied_paths = [ProxiedPath( |
| 256 | + username=db_proxied_path.username, |
| 257 | + sharing_key=db_proxied_path.sharing_key, |
| 258 | + sharing_name=db_proxied_path.sharing_name, |
| 259 | + mount_path=db_proxied_path.mount_path |
| 260 | + ) for db_proxied_path in db_proxied_paths] |
| 261 | + return ProxiedPathResponse(paths=proxied_paths) |
255 | 262 |
|
256 | 263 |
|
257 | 264 | @app.get("/proxied-path/{username}/{sharing_key}", response_model=ProxiedPath, |
|
0 commit comments