mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
redirect on invalid lists id route
This commit is contained in:
parent
7087e100ba
commit
a9f6074efd
1 changed files with 2 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { Table } from 'antd';
|
||||
import React from 'react';
|
||||
import { Route, RouteComponentProps } from 'react-router-dom';
|
||||
import { Redirect, Route, RouteComponentProps } from 'react-router-dom';
|
||||
|
||||
import { Language } from '../../interfaces/Language';
|
||||
import { List } from '../../interfaces/List';
|
||||
|
|
@ -141,7 +141,7 @@ export class ListsTable extends React.Component<RouteComponentProps, State> {
|
|||
const list = this.state.lists.find(l => l.id === +props.match.params.id);
|
||||
return list
|
||||
? <ListDetailsDrawer list={list as List} {...props} />
|
||||
: null //TODO: redirect or 404 for invalid list id
|
||||
: <Redirect to={{ pathname: "/", }} />
|
||||
}} />
|
||||
</span>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue