Fixed problem with article editor routing.

This commit is contained in:
Martin Sosic 2020-11-22 17:18:03 +01:00
parent d0044dd320
commit 8ffc7ebdae
2 changed files with 5 additions and 1 deletions

View File

@ -25,6 +25,8 @@ const ArticleEditorPage = (props) => {
return <span> Please <Link to='/login'>log in</Link>. </span> return <span> Please <Link to='/login'>log in</Link>. </span>
} }
console.log('here', article)
return articleError return articleError
? articleError.message || articleError ? articleError.message || articleError
: ( : (
@ -39,6 +41,8 @@ const ArticleEditor = (props) => {
const user = props.user const user = props.user
const article = props.article const article = props.article
console.log(article)
const history = useHistory() const history = useHistory()
const [title, setTitle] = useState(article?.title || '') const [title, setTitle] = useState(article?.title || '')

View File

@ -27,7 +27,7 @@ page UserProfile {
component: import UserProfile from "@ext/UserProfilePage.js" component: import UserProfile from "@ext/UserProfilePage.js"
} }
route "/editor/:articleId" -> page ArticleEditor route "/editor/:articleId?" -> page ArticleEditor
page ArticleEditor { page ArticleEditor {
component: import ArticleEditor from "@ext/ArticleEditorPage.js" component: import ArticleEditor from "@ext/ArticleEditorPage.js"
} }