diff options
| author | Georgios Andreadis <info@gandreadis.com> | 2020-07-03 10:34:05 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:47:22 +0200 |
| commit | 39277c91281dbc7bd40bdffabc5b5675e9ede483 (patch) | |
| tree | 24a8bc60bef68f911748e1ca635e525b9888a298 /web-server/opendc/api | |
| parent | 107a48e1a7fa0ec56faad8d8e90f76521f39f3b2 (diff) | |
Get basic topology change working
Diffstat (limited to 'web-server/opendc/api')
| -rw-r--r-- | web-server/opendc/api/v2/simulations/simulationId/topologies/endpoint.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/web-server/opendc/api/v2/simulations/simulationId/topologies/endpoint.py b/web-server/opendc/api/v2/simulations/simulationId/topologies/endpoint.py index 09c84019..7c07e63b 100644 --- a/web-server/opendc/api/v2/simulations/simulationId/topologies/endpoint.py +++ b/web-server/opendc/api/v2/simulations/simulationId/topologies/endpoint.py @@ -16,10 +16,12 @@ def POST(request): simulation.check_exists() simulation.check_user_access(request.google_id, True) - topology = Topology({'name': request.params_body['topology']['name']}) + topology = Topology({ + 'simulationId': request.params_path['simulationId'], + 'name': request.params_body['topology']['name'], + 'rooms': request.params_body['topology']['rooms'], + }) - topology.set_property('datetimeCreated', Database.datetime_to_string(datetime.now())) - topology.set_property('datetimeLastEdited', Database.datetime_to_string(datetime.now())) topology.insert() simulation.obj['topologyIds'].append(topology.get_id()) |
