Polish app/server.js

This commit is contained in:
Sébastien Chopin 2017-07-09 16:50:55 +02:00
parent 78400042ef
commit f07d9855b6

View File

@ -153,7 +153,8 @@ export default async context => {
if (typeof Component.options.validate !== 'function') return if (typeof Component.options.validate !== 'function') return
isValid = Component.options.validate({ isValid = Component.options.validate({
params: context.route.params || {}, params: context.route.params || {},
query: context.route.query || {}<%= (store ? ', store: ctx.store' : '') %> query: context.route.query || {},
<%= (store ? 'store: ctx.store' : '') %>
}) })
}) })
// ...If .validate() returned false // ...If .validate() returned false
@ -195,7 +196,7 @@ export default async context => {
} }
return Promise.all(promises).then(data => { return Promise.all(promises).then(data => {
// If not dyanmic component, return data directly // If no dynamic component, return data directly
if (Object.keys(_this.components).length === 0) { if (Object.keys(_this.components).length === 0) {
return data return data
} }