mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-29 06:15:29 -04:00
Fix Communication between frontend and backend (#1201)
Co-authored-by: Tilman Vatteroth <git@tilmanvatteroth.de> Signed-off-by: Philip Molares <philip.molares@udo.edu> Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
4a18e51c83
commit
9cf7980334
38 changed files with 268 additions and 164 deletions
|
@ -9,6 +9,7 @@ import { Redirect } from 'react-router'
|
|||
import { useParams } from 'react-router-dom'
|
||||
import { getNote } from '../../../api/notes'
|
||||
import { NotFoundErrorScreen } from './not-found-error-screen'
|
||||
import { NoteDto } from '../../../api/notes/types'
|
||||
|
||||
interface RouteParameters {
|
||||
id: string
|
||||
|
@ -20,7 +21,7 @@ export const Redirector: React.FC = () => {
|
|||
|
||||
useEffect(() => {
|
||||
getNote(id)
|
||||
.then((noteFromAPI) => setError(!noteFromAPI.preVersionTwoNote))
|
||||
.then((noteFromAPI: NoteDto) => setError(noteFromAPI.metadata.version !== 1))
|
||||
.catch(() => setError(true))
|
||||
}, [id])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue