diff options
| author | Georgios Andreadis <info@gandreadis.com> | 2020-07-01 14:02:06 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:47:20 +0200 |
| commit | 85901acea556c69891b13ab7299cd62445292c7a (patch) | |
| tree | 3daffa1a9600df8471a78db719b7964b0bc5c9ef /web-server/opendc/api/v2/simulations | |
| parent | de8f12d74faef5fa3f9e38d1340948cab2d06ea3 (diff) | |
Fix simulation interface
Diffstat (limited to 'web-server/opendc/api/v2/simulations')
| -rw-r--r-- | web-server/opendc/api/v2/simulations/endpoint.py | 2 | ||||
| -rw-r--r-- | web-server/opendc/api/v2/simulations/simulationId/endpoint.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/web-server/opendc/api/v2/simulations/endpoint.py b/web-server/opendc/api/v2/simulations/endpoint.py index c978fad7..bcdea650 100644 --- a/web-server/opendc/api/v2/simulations/endpoint.py +++ b/web-server/opendc/api/v2/simulations/endpoint.py @@ -15,7 +15,7 @@ def POST(request): topology = Topology({'name': 'Default topology', 'rooms': []}) topology.insert() - simulation = Simulation({'simulation': request.params_body['simulation']}) + simulation = Simulation(request.params_body['simulation']) simulation.set_property('datetimeCreated', Database.datetime_to_string(datetime.now())) simulation.set_property('datetimeLastEdited', Database.datetime_to_string(datetime.now())) simulation.set_property('topologyIds', [topology.get_id()]) diff --git a/web-server/opendc/api/v2/simulations/simulationId/endpoint.py b/web-server/opendc/api/v2/simulations/simulationId/endpoint.py index 05b38686..93617ea8 100644 --- a/web-server/opendc/api/v2/simulations/simulationId/endpoint.py +++ b/web-server/opendc/api/v2/simulations/simulationId/endpoint.py @@ -55,6 +55,6 @@ def DELETE(request): experiment = Experiment.from_id(experiment_id) experiment.delete() - simulation.delete() + old_object = simulation.delete() - return Response(200, 'Successfully deleted simulation.', simulation.obj) + return Response(200, 'Successfully deleted simulation.', old_object) |
