From 28dede96871728409dc1790c55dfaf3b82ca8e91 Mon Sep 17 00:00:00 2001 From: Nabarun Gogoi Date: Wed, 14 Mar 2018 15:33:17 +0530 Subject: [PATCH] pull request for issue #3018 --- lib/app/client.js | 6 +----- lib/app/server.js | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/app/client.js b/lib/app/client.js index 0e4ee34a3b..759fdb58b2 100644 --- a/lib/app/client.js +++ b/lib/app/client.js @@ -270,11 +270,7 @@ async function render (to, from, next) { Components.forEach(Component => { if (!isValid) return if (typeof Component.options.validate !== 'function') return - isValid = Component.options.validate({ - params: to.params || {}, - query : to.query || {}, - <% if(store) { %>store<% } %> - }) + isValid = Component.options.validate(app.context) }) // ...If .validate() returned false if (!isValid) { diff --git a/lib/app/server.js b/lib/app/server.js index 6a8f006401..ef231e7d9f 100644 --- a/lib/app/server.js +++ b/lib/app/server.js @@ -157,11 +157,7 @@ export default async ssrContext => { Components.forEach((Component) => { if (!isValid) return if (typeof Component.options.validate !== 'function') return - isValid = Component.options.validate({ - params: app.context.route.params || {}, - query: app.context.route.query || {}, - <%= (store ? 'store' : '') %> - }) + isValid = Component.options.validate(app.context) }) // ...If .validate() returned false if (!isValid) {