Fix Dashboard delete button

Nothing was being passed in, also moved the closure to where the
function is defined
pull/3103/head
Alex P 2018-03-30 14:57:45 -07:00
parent d18cbb15e1
commit 35203da2db
2 changed files with 2 additions and 5 deletions

View File

@ -36,9 +36,6 @@ const DashboardsTable = ({
onCloneDashboard,
dashboardLink,
}) => {
const wrappedDelete = dashboard => () => {
onDeleteDashboard(dashboard)
}
return dashboards && dashboards.length ? (
<table className="table v-center admin-table table-highlight">
<thead>
@ -80,7 +77,7 @@ const DashboardsTable = ({
Clone
</button>
<ConfirmButton
confirmAction={wrappedDelete}
confirmAction={onDeleteDashboard(dashboard)}
size="btn-xs"
type="btn-danger"
text="Delete"

View File

@ -28,7 +28,7 @@ class DashboardsPage extends Component {
createDashboard({...dashboard, name: `${dashboard.name} (Clone)`})
}
handleDeleteDashboard = dashboard => {
handleDeleteDashboard = dashboard => () => {
this.props.handleDeleteDashboard(dashboard)
}