Rename link to pathname

pull/10616/head
deniz kusefoglu 2018-02-07 11:56:31 -08:00
parent a4b1522c38
commit 61e4e08991
1 changed files with 4 additions and 4 deletions

View File

@ -25,7 +25,7 @@ class KapacitorRule extends Component {
this.setState({timeRange})
}
handleCreate = link => {
handleCreate = pathname => {
const {
addFlashMessage,
queryConfigs,
@ -42,7 +42,7 @@ class KapacitorRule extends Component {
createRule(kapacitor, newRule)
.then(() => {
router.push(link || `/sources/${source.id}/alert-rules`)
router.push(pathname || `/sources/${source.id}/alert-rules`)
addFlashMessage({type: 'success', text: 'Rule successfully created'})
})
.catch(() => {
@ -53,7 +53,7 @@ class KapacitorRule extends Component {
})
}
handleEdit = link => {
handleEdit = pathname => {
const {addFlashMessage, queryConfigs, rule, router, source} = this.props
const updatedRule = Object.assign({}, rule, {
query: queryConfigs[rule.queryID],
@ -61,7 +61,7 @@ class KapacitorRule extends Component {
editRule(updatedRule)
.then(() => {
router.push(link || `/sources/${source.id}/alert-rules`)
router.push(pathname || `/sources/${source.id}/alert-rules`)
addFlashMessage({
type: 'success',
text: `${rule.name} successfully saved!`,