Skip to content

Commit

Permalink
Improve error logging on server; add createdAt to PostsList fragment;…
Browse files Browse the repository at this point in the history
… use componentNames for base routes
  • Loading branch information
SachaG committed Feb 4, 2017
1 parent 3cde24d commit bdfa76a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions packages/_react-router-ssr/lib/server.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ function generateSSRData(clientOptions, serverOptions, req, res, renderProps) {
InjectData.pushData(res, 'fast-render-data', data);
}
catch(err) {
console.log(err)
console.error(new Date(), 'error while server-rendering', err.stack);
}
});
Expand Down
3 changes: 2 additions & 1 deletion packages/nova-base-components/lib/fragments.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { registerFragment } from 'meteor/nova:core';
import { registerFragment, getFragment } from 'meteor/nova:core';

// ------------------------------ Vote ------------------------------ //

Expand Down Expand Up @@ -99,6 +99,7 @@ registerFragment(`
url
slug
postedAt
createdAt
sticky
status
body
Expand Down
16 changes: 8 additions & 8 deletions packages/nova-base-components/lib/routes.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { getComponent, addRoute } from 'meteor/nova:core';
import { addRoute } from 'meteor/nova:core';

addRoute([
{name:'posts.list', path: '/', component: getComponent('PostsHome')}, // index route
{name:'posts.daily', path:'daily', component: getComponent('PostsDaily')},
{name:'posts.single', path:'posts/:_id(/:slug)', component: getComponent('PostsSingle')},
{name:'users.single', path:'users/:slug', component: getComponent('UsersSingle')},
{name:'users.account', path:'account', component: getComponent('UsersAccount')},
{name:'resetPassword', path:'reset-password/:token', component: getComponent('UsersResetPassword')},
{name:'users.edit', path:'users/:slug/edit', component: getComponent('UsersAccount')},
{name:'posts.list', path: '/', componentName: 'PostsHome'}, // index route
{name:'posts.daily', path:'daily', componentName: 'PostsDaily'},
{name:'posts.single', path:'posts/:_id(/:slug)', componentName: 'PostsSingle'},
{name:'users.single', path:'users/:slug', componentName: 'UsersSingle'},
{name:'users.account', path:'account', componentName: 'UsersAccount'},
{name:'resetPassword', path:'reset-password/:token', componentName: 'UsersResetPassword'},
{name:'users.edit', path:'users/:slug/edit', componentName: 'UsersAccount'},
]);
1 change: 0 additions & 1 deletion packages/nova-posts/lib/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const schema = {
type: Date,
optional: true,
viewableBy: ['admins'],
publish: true, // publish so that admins can sort pending posts by createdAt
autoValue: (documentOrModifier) => {
if (documentOrModifier && !documentOrModifier.$set) return new Date() // if this is an insert, set createdAt to current timestamp
}
Expand Down

0 comments on commit bdfa76a

Please sign in to comment.