Skip to content
Snippets Groups Projects
Unverified Commit a3f8f519 authored by Tom Robinson's avatar Tom Robinson
Browse files

Go to correct collection url after changing collection name. Resolves #4032

parent 67641b40
No related branches found
No related tags found
No related merge requests found
import { createAction, createThunkAction, handleActions, combineReducers } from "metabase/lib/redux";
import { reset } from 'redux-form';
import { goBack } from "react-router-redux";
import { push } from "react-router-redux";
import Urls from "metabase/lib/urls";
import _ from "underscore";
......@@ -36,7 +37,7 @@ export const saveCollection = createThunkAction(SAVE_COLLECTION, (collection) =>
if (response.id != null) {
dispatch(reset("collection"));
}
dispatch(goBack())
dispatch(push(Urls.collection(response)));
return response;
} catch (e) {
// redux-form expects an object with either { field: error } or { _error: error }
......
......@@ -29,7 +29,7 @@ class CollectionButton extends Component {
}
render () {
const { id, name, color, slug, isAdmin, push } = this.props;
const { id, name, color, slug, isAdmin } = this.props;
return (
<Link
to={`/questions/collections/${slug}`}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment