const dataTypeStr = paramUpdates.dataType || DataType[this.state.dataType];
const sortStr = paramUpdates.sort || this.state.sort;
const page = paramUpdates.page || this.state.page;
+
+ let typeView = this.state.communityName
+ ? `/c/${this.state.communityName}`
+ : `/community/${this.state.communityId}`;
+
this.props.history.push(
- `/c/${this.state.communityRes.community_view.community.name}/data_type/${dataTypeStr}/sort/${sortStr}/page/${page}`
+ `${typeView}/data_type/${dataTypeStr}/sort/${sortStr}/page/${page}`
);
}
fetchInitialData: req => Post.fetchInitialData(req),
},
{
- path: `/c/:name/data_type/:data_type/sort/:sort/page/:page`,
+ path: `/community/:id/data_type/:data_type/sort/:sort/page/:page`,
component: Community,
fetchInitialData: req => Community.fetchInitialData(req),
},
component: Community,
fetchInitialData: req => Community.fetchInitialData(req),
},
+ {
+ path: `/c/:name/data_type/:data_type/sort/:sort/page/:page`,
+ component: Community,
+ fetchInitialData: req => Community.fetchInitialData(req),
+ },
{
path: `/c/:name`,
component: Community,