summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/api
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2023-03-26 21:20:42 +0100
committerFabian Mastenbroek <mail.fabianm@gmail.com>2023-03-26 21:22:18 +0100
commita9da76621c1be7a11bf292e868a8f7c22f2ea203 (patch)
tree51aa097044559a45d18b9dbe44002a0dd2af2bf1 /opendc-web/opendc-web-ui/src/api
parent6bc9b999ff0d9a0ad2c1c5bea1554abc30a06c5b (diff)
bug(web): Inform user when deleted topology is still used
This change fixes #135 which showed that trying to delete a topology used by a scenario would result in nothing happening in the UI and a 500 error being returned by the server. We check whether a scenario still references the topology and show an error to the user if that happens. Fixes #135
Diffstat (limited to 'opendc-web/opendc-web-ui/src/api')
-rw-r--r--opendc-web/opendc-web-ui/src/api/index.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/opendc-web/opendc-web-ui/src/api/index.js b/opendc-web/opendc-web-ui/src/api/index.js
index 75751658..3411b96e 100644
--- a/opendc-web/opendc-web-ui/src/api/index.js
+++ b/opendc-web/opendc-web-ui/src/api/index.js
@@ -49,7 +49,7 @@ export async function request(auth, path, method = 'GET', body) {
const json = await response.json()
if (!response.ok) {
- throw response.message
+ throw json.message
}
return json