From e1622bfe19f0fe9c55412d0fd53a7af58eed2d0e Mon Sep 17 00:00:00 2001 From: Rommel Manalo Date: Fri, 7 Apr 2017 20:50:41 +0800 Subject: [PATCH] Should call the property of parentRouteName properly by using "[]" and not by "." notation --- packages/vulcan-lib/lib/modules/routes.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/vulcan-lib/lib/modules/routes.js b/packages/vulcan-lib/lib/modules/routes.js index 36ead95aa..9a4eb74e1 100644 --- a/packages/vulcan-lib/lib/modules/routes.js +++ b/packages/vulcan-lib/lib/modules/routes.js @@ -1,4 +1,4 @@ -import { Components, getComponent } from './components'; +import {Components, getComponent} from './components'; export const Routes = {}; // will be populated on startup (see vulcan:routing) export const RoutesTable = {}; // storage for infos about routes themselves @@ -23,7 +23,7 @@ export const addRoute = (routeOrRouteArray, parentRouteName) => { if (parentRouteName) { addAsChildRoute(parentRouteName, addedRoutes); - + } else { // modify the routes table with the new routes @@ -66,7 +66,7 @@ export const addRoute = (routeOrRouteArray, parentRouteName) => { const addAsChildRoute = (parentRouteName, addedRoutes) => { // if the parentRouteName does not exist, error - if (!RoutesTable.parentRouteName) { + if (!RoutesTable[parentRouteName]) { throw new Error(`Route ${parentRouteName} doesn't exist`) }