Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
|
| 2 |
from fastapi.responses import JSONResponse
|
| 3 |
from typing import Dict, List, Optional
|
| 4 |
import itertools
|
|
@@ -405,7 +405,7 @@ def delete_criteria_sets(payload: Dict) -> Response:
|
|
| 405 |
|
| 406 |
|
| 407 |
@app.get("/api/v1/criteria-sets/export")
|
| 408 |
-
def export_criteria_sets(format: str = Query(...,
|
| 409 |
return {"message": f"Generated {format} export for criteria sets"}
|
| 410 |
|
| 411 |
|
|
@@ -624,7 +624,7 @@ def post_evaluation_chat(item_id: int, payload: Dict):
|
|
| 624 |
|
| 625 |
|
| 626 |
@app.get("/api/v1/evaluations/export")
|
| 627 |
-
def export_evaluations(format: str = Query(...,
|
| 628 |
return {"message": f"Generated {format} export for evaluations"}
|
| 629 |
|
| 630 |
|
|
@@ -650,7 +650,7 @@ def export_reports(
|
|
| 650 |
reportType: str = Query(..., alias="reportType"),
|
| 651 |
period: int = Query(..., ge=1, le=12),
|
| 652 |
year: int = Query(..., ge=2000),
|
| 653 |
-
format: str = Query(...,
|
| 654 |
):
|
| 655 |
return {"message": f"Generated {format} export for {reportType} {period}/{year}"}
|
| 656 |
|
|
|
|
| 1 |
+
from fastapi import FastAPI, HTTPException, UploadFile, File, Query, Response
|
| 2 |
from fastapi.responses import JSONResponse
|
| 3 |
from typing import Dict, List, Optional
|
| 4 |
import itertools
|
|
|
|
| 405 |
|
| 406 |
|
| 407 |
@app.get("/api/v1/criteria-sets/export")
|
| 408 |
+
def export_criteria_sets(format: str = Query(..., pattern="^(pdf|xlsx)$")):
|
| 409 |
return {"message": f"Generated {format} export for criteria sets"}
|
| 410 |
|
| 411 |
|
|
|
|
| 624 |
|
| 625 |
|
| 626 |
@app.get("/api/v1/evaluations/export")
|
| 627 |
+
def export_evaluations(format: str = Query(..., pattern="^(pdf|xlsx)$")):
|
| 628 |
return {"message": f"Generated {format} export for evaluations"}
|
| 629 |
|
| 630 |
|
|
|
|
| 650 |
reportType: str = Query(..., alias="reportType"),
|
| 651 |
period: int = Query(..., ge=1, le=12),
|
| 652 |
year: int = Query(..., ge=2000),
|
| 653 |
+
format: str = Query(..., pattern="^(pdf|xlsx|docx)$"),
|
| 654 |
):
|
| 655 |
return {"message": f"Generated {format} export for {reportType} {period}/{year}"}
|
| 656 |
|