From a19af5db2f35508311cbf36d0237c17b9547db62 Mon Sep 17 00:00:00 2001 From: Mix Date: Wed, 27 Dec 2017 19:32:16 -0300 Subject: [PATCH] redirect --- infra/router/resources.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/infra/router/resources.js b/infra/router/resources.js index befb27b..e639f5c 100644 --- a/infra/router/resources.js +++ b/infra/router/resources.js @@ -7,10 +7,11 @@ import { Crud } from 'genesis' * @param {Function|Object|boolean} props * @param {Object} meta * @param {Array} children + * @param {Object/string} redirect * @returns {Object} */ -export const route = (path, name, component, props = null, meta = {}, children = []) => { - return {path, name, component, props, meta, children} +export const route = (path, name, component, props = null, meta = {}, children = [], redirect = null) => { + return {path, name, component, props, meta, children, redirect} } /** @@ -30,10 +31,11 @@ export const route = (path, name, component, props = null, meta = {}, children = * @param {string} component * @param {Object} meta * @param {string} name + * @param {Object/string} redirect * @returns {Object} */ -export const child = (path, namespace, props, uri, scope, component, meta = {}, name = '') => { - return route(uri, name || (namespace + '.' + scope), component, (route) => props(scope, route), meta) +export const child = (path, namespace, props, uri, scope, component, meta = {}, name = '', redirect = null) => { + return route(uri, name || (namespace + '.' + scope), component, (route) => props(scope, route), meta, redirect) } /**