removes dynamic collection routes, uses route param instead

This commit is contained in:
James
2019-02-16 15:24:07 -05:00
parent a90b1ae5b5
commit 103d22e07c
8 changed files with 112 additions and 113 deletions

View File

@@ -19,14 +19,14 @@ const withEditData = PassedComponent => {
}
fetchData = () => {
const slug = this.props.match.params.slug;
const { id } = this.props.match.params;
const params = {
locale: this.props.locale
};
if (slug) {
api.requests.get(`${this.props.config.serverUrl}/${this.props.collection.slug}/${slug}`, params).then(
if (id) {
api.requests.get(`${this.props.config.serverUrl}/${this.props.collection.slug}/${id}`, params).then(
res => this.setState({ data: res }),
err => {
console.warn(err);