summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2022-09-14 13:49:58 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2022-09-20 16:07:05 +0200
commit419297128ce2ab2c8085c81fafdb843c1135661d (patch)
tree9fa1d61f46c4f313d6b5c41096f83bfc831a3718 /opendc-web/opendc-web-ui/src
parentb81f984e98f12742c645787f28ac483ac85c8843 (diff)
fix(web/ui): Fix deletion of topology
This change fixes an issue with the OpenDC web interface where the user cannot remove an existing topology from the topology table due to a programming mistake.
Diffstat (limited to 'opendc-web/opendc-web-ui/src')
-rw-r--r--opendc-web/opendc-web-ui/src/components/topologies/map/TileContainer.js2
-rw-r--r--opendc-web/opendc-web-ui/src/data/topology.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/opendc-web/opendc-web-ui/src/components/topologies/map/TileContainer.js b/opendc-web/opendc-web-ui/src/components/topologies/map/TileContainer.js
index 21be3c79..ef5af263 100644
--- a/opendc-web/opendc-web-ui/src/components/topologies/map/TileContainer.js
+++ b/opendc-web/opendc-web-ui/src/components/topologies/map/TileContainer.js
@@ -28,9 +28,9 @@ import TileGroup from './groups/TileGroup'
function TileContainer({ tileId, ...props }) {
const interactionLevel = useSelector((state) => state.interactionLevel)
+ const dispatch = useDispatch()
const tile = useSelector((state) => state.topology.tiles[tileId])
- const dispatch = useDispatch()
const onClick = (tile) => {
if (tile.rack) {
dispatch(goFromRoomToRack(tile.id))
diff --git a/opendc-web/opendc-web-ui/src/data/topology.js b/opendc-web/opendc-web-ui/src/data/topology.js
index cf098c56..ac6cabe5 100644
--- a/opendc-web/opendc-web-ui/src/data/topology.js
+++ b/opendc-web/opendc-web-ui/src/data/topology.js
@@ -49,7 +49,7 @@ export function configureTopologyClient(queryClient, auth) {
},
})
queryClient.setMutationDefaults('deleteTopology', {
- mutationFn: ({ projectId, id }) => deleteTopology(auth, projectId, id),
+ mutationFn: ({ projectId, number }) => deleteTopology(auth, projectId, number),
onSuccess: (result) => {
queryClient.setQueryData(['topologies', result.project.id], (old = []) =>
old.filter((topology) => topology.id !== result.id)