diff --git a/api/app.py b/api/app.py index 6baccd36..1ed3a267 100644 --- a/api/app.py +++ b/api/app.py @@ -97,7 +97,10 @@ async def FetchPlan(id: str, db: MongoDBConnection = Depends(get_mongo_conn)): response = await db.get_record(id) if response is None: raise HTTPException(status_code=404, detail="Plan not found") - return response["json_data"], response["validator_overrides"] + return { + "json_data": response["json_data"], + "validator_overrides": response["validator_overrides"], + } # For defining custom documentation for the server diff --git a/client/src/views/CodeView.vue b/client/src/views/CodeView.vue index aa0db34d..62008fc9 100644 --- a/client/src/views/CodeView.vue +++ b/client/src/views/CodeView.vue @@ -162,7 +162,7 @@ export default { }, async loadPlan(id) { const resp = await getPlan(id); - const jsonObject = JSON.parse(resp.data[0]); + const jsonObject = JSON.parse(resp.data.json_data); this.code = JSON.stringify(jsonObject, null, 2); this.language = "json"; @@ -172,7 +172,7 @@ export default { models[0].setValue(this.code); this.clearValidationOverrideLevel(); - resp.data[1].forEach((value) => { + resp.data.validator_overrides.forEach((value) => { this.addValidationOverrideLevel(value); }); },