Skip to content

Commit

Permalink
Use const assertions in Routes.tsx (#1244)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonAlling authored and Andres Martinez Gotor committed Oct 23, 2019
1 parent 7b48340 commit e760e7d
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions dashboard/src/containers/RoutesContainer/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ import ServiceInstanceViewContainer from "../../containers/ServiceInstanceViewCo

type IRouteComponentPropsAndRouteProps = RouteProps & RouteComponentProps<any>;

const privateRoutes: {
[route: string]: React.ComponentType<RouteComponentProps<any>> | React.ComponentType<any>;
} = {
const privateRoutes = {
"/apps/ns/:namespace": AppListContainer,
"/apps/ns/:namespace/:releaseName": AppViewContainer,
"/apps/ns/:namespace/new/:repo/:id/versions/:version": AppNewContainer,
Expand All @@ -36,14 +34,12 @@ const privateRoutes: {
"/services/brokers/:brokerName/instances/ns/:namespace/:instanceName": ServiceInstanceViewContainer,
"/services/classes": ServiceClassListContainer,
"/services/instances/ns/:namespace": ServiceInstanceListContainer,
};
} as const;

// Public routes that don't require authentication
const routes: {
[route: string]: React.ComponentType<RouteComponentProps<any>> | React.ComponentType<any>;
} = {
const routes = {
"/login": LoginFormContainer,
};
} as const;

interface IRoutesProps extends IRouteComponentPropsAndRouteProps {
namespace: string;
Expand Down

0 comments on commit e760e7d

Please sign in to comment.