Redirect user to freshly cloned dashboard after cloning

pull/3103/head
Alex P 2018-03-30 15:37:23 -07:00
parent 4372454219
commit 14c7428376
1 changed files with 7 additions and 3 deletions

View File

@ -23,9 +23,13 @@ class DashboardsPage extends Component {
push(`/sources/${id}/dashboards/${data.id}`)
}
handleCloneDashboard = dashboard => () => {
console.log(dashboard)
createDashboard({...dashboard, name: `${dashboard.name} (Clone)`})
handleCloneDashboard = dashboard => async () => {
const {source: {id}, router: {push}} = this.props
const {data} = await createDashboard({
...dashboard,
name: `${dashboard.name} (clone)`,
})
push(`/sources/${id}/dashboards/${data.id}`)
}
handleDeleteDashboard = dashboard => () => {