Change "new entry" path to avoid slug conflicts.

This commit is contained in:
Caleb 2017-10-12 19:51:28 -06:00 committed by Shawn Erquhart
parent 9d9efdd66a
commit 8b5dc61e6c
2 changed files with 2 additions and 2 deletions

View File

@ -197,7 +197,7 @@ class App extends React.Component {
<Switch>
<Route exact path='/' component={DashboardPage} />
<Route exact path="/collections/:name" component={CollectionPage} />
<Route path="/collections/:name/entries/new" render={(props) => (<EntryPage {...props} newRecord={true}/>)} />
<Route path="/collections/:name/new" render={(props) => (<EntryPage {...props} newRecord />)} />
<Route path="/collections/:name/entries/:slug" component={EntryPage} />
<Route path="/search/:searchTerm" component={SearchPage} />
<Route component={NotFoundPage} />

View File

@ -10,7 +10,7 @@ export function getCollectionUrl(collectionName, direct) {
}
export function getNewEntryUrl(collectionName, direct) {
return getUrl(`/collections/${ collectionName }/entries/new`, direct);
return getUrl(`/collections/${ collectionName }/new`, direct);
}
/* See https://www.w3.org/International/articles/idn-and-iri/#path.