File tree Expand file tree Collapse file tree 2 files changed +28
-15
lines changed Expand file tree Collapse file tree 2 files changed +28
-15
lines changed Original file line number Diff line number Diff line change 1+ export default interface PageResponse < T > {
2+ count : number ,
3+ next : string ,
4+ previous : string ,
5+ results : T [ ]
6+ }
7+
8+ export interface Response < T > {
9+ data : T ,
10+ status : number ,
11+ statusText : string ,
12+ config : object
13+ } ;
Original file line number Diff line number Diff line change @@ -3,29 +3,29 @@ import { Route, Redirect } from "react-router-dom";
33import { Children } from "../interfaces/Children"
44
55export interface PrivateRouteProps {
6- isAuthenticated : boolean
7- children : Children
8- exact : boolean
9- path : string
6+ isAuthenticated : boolean
7+ children : Children
8+ exact : boolean
9+ path : string
1010}
1111
1212// A wrapper for <Route> that redirects to the login screen if you're not yet authenticated.
13- export default function PrivateRoute ( { isAuthenticated, children, ...rest } : PrivateRouteProps ) {
14- return (
15- < Route
16- { ...rest }
17- render = { ( { location } ) =>
13+ export default function PrivateRoute ( { isAuthenticated, children, ...rest } : PrivateRouteProps ) {
14+ return (
15+ < Route
16+ { ...rest }
17+ render = { ( { location } ) =>
1818 isAuthenticated ? (
19- children
20- ) : (
19+ children
20+ ) : (
2121 < Redirect
2222 to = { {
2323 pathname : "/login/" ,
2424 state : { from : location }
2525 } }
2626 />
2727 )
28- }
29- />
30- ) ;
31- }
28+ }
29+ />
30+ ) ;
31+ }
You can’t perform that action at this time.
0 commit comments