summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/machine/DeleteMachine.js
diff options
context:
space:
mode:
Diffstat (limited to 'opendc-web/opendc-web-ui/src/components/app/sidebars/topology/machine/DeleteMachine.js')
-rw-r--r--opendc-web/opendc-web-ui/src/components/app/sidebars/topology/machine/DeleteMachine.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/machine/DeleteMachine.js b/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/machine/DeleteMachine.js
index a7bf3719..75d458b6 100644
--- a/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/machine/DeleteMachine.js
+++ b/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/machine/DeleteMachine.js
@@ -21,18 +21,20 @@
*/
import React, { useState } from 'react'
-import { useDispatch } from 'react-redux'
+import { useDispatch, useSelector } from 'react-redux'
import { deleteMachine } from '../../../../../redux/actions/topology/machine'
import { Button } from '@patternfly/react-core'
import TrashIcon from '@patternfly/react-icons/dist/js/icons/trash-icon'
import ConfirmationModal from '../../../../modals/ConfirmationModal'
-const DeleteMachine = () => {
+function DeleteMachine() {
const dispatch = useDispatch()
const [isVisible, setVisible] = useState(false)
+ const rackId = useSelector((state) => state.objects.tile[state.interactionLevel.tileId].rack)
+ const position = useSelector((state) => state.interactionLevel.position)
const callback = (isConfirmed) => {
if (isConfirmed) {
- dispatch(deleteMachine())
+ dispatch(deleteMachine(rackId, position))
}
setVisible(false)
}