summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/data
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/data
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/data')
-rw-r--r--opendc-web/opendc-web-ui/src/data/topology.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/opendc-web/opendc-web-ui/src/data/topology.js b/opendc-web/opendc-web-ui/src/data/topology.js
index ac6cabe5..d5e624d5 100644
--- a/opendc-web/opendc-web-ui/src/data/topology.js
+++ b/opendc-web/opendc-web-ui/src/data/topology.js
@@ -83,6 +83,6 @@ export function useNewTopology() {
/**
* Create a mutation for deleting a topology.
*/
-export function useDeleteTopology() {
- return useMutation('deleteTopology')
+export function useDeleteTopology(options = {}) {
+ return useMutation('deleteTopology', options)
}