Skip to content

Commit

Permalink
fix(backend): use XLSFormType enum for raw-data-api config selection
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Jun 10, 2024
1 parent dd05ec5 commit ef16c36
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/backend/app/projects/project_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ async def preview_split_by_square(
@router.post("/generate-data-extract/")
async def get_data_extract(
geojson_file: UploadFile = File(...),
form_category: Optional[str] = Form(None),
form_category: Optional[XLSFormType] = Form(None),
# config_file: Optional[str] = Form(None),
current_user: AuthUser = Depends(login_required),
):
Expand All @@ -826,7 +826,8 @@ async def get_data_extract(

# Get extract config file from existing data_models
if form_category:
data_model = f"{data_models_path}/{form_category}.yaml"
config_filename = XLSFormType(form_category).name
data_model = f"{data_models_path}/{config_filename}.yaml"
with open(data_model, "rb") as data_model_yaml:
extract_config = BytesIO(data_model_yaml.read())
else:
Expand Down

0 comments on commit ef16c36

Please sign in to comment.