Get app to run

This commit is contained in:
SachaG 2017-09-04 20:06:06 +09:00
parent 62dffa6a9d
commit 66b8570422
5 changed files with 18 additions and 9 deletions

View file

@ -37,7 +37,7 @@ class PostsItem extends PureComponent {
<div className={postClass}>
<div className="posts-item-vote">
<Components.Vote collection={Posts} document={post} currentUser={this.props.currentUser}/>
{/* TODO <Components.Vote collection={Posts} document={post} currentUser={this.props.currentUser}/>*/}
</div>
{post.thumbnailUrl ? <Components.PostsThumbnail post={post}/> : null}

View file

@ -20,7 +20,7 @@ registerFragment(`
...UsersMinimumInfo
}
# vulcan:embedly
thumbnailUrl
# thumbnailUrl
# vulcan:categories
categories {
...CategoriesMinimumInfo

View file

@ -4,6 +4,15 @@ GraphQL config
*/
import { addGraphQLMutation } from 'meteor/vulcan:core';
import { addGraphQLMutation, addGraphQLResolvers } from 'meteor/vulcan:core';
const specificResolvers = {
Mutation: {
increasePostViewCount(root, { postId }, context) {
return context.Posts.update({_id: postId}, { $inc: { viewCount: 1 }});
}
}
};
addGraphQLResolvers(specificResolvers);
addGraphQLMutation('increasePostViewCount(postId: String): Float');

View file

@ -36,7 +36,7 @@ var createPost = function (slug, postedAt, username, thumbnail) {
var post = {
postedAt: postedAt,
body: Assets.getText("content/" + slug + ".md"),
body: Assets.getText("lib/assets/content/" + slug + ".md"),
title: toTitleCase(slug.replace(/_/g, ' ')),
dummySlug: slug,
isDummy: true,
@ -44,7 +44,7 @@ var createPost = function (slug, postedAt, username, thumbnail) {
};
if (typeof thumbnail !== "undefined")
post.thumbnailUrl = "/packages/vulcan_getting-started/content/images/" + thumbnail;
post.thumbnailUrl = "/packages/example-forum/lib/assets/images/" + thumbnail;
newMutation({
collection: Posts,

View file

@ -46,10 +46,10 @@ Package.onUse(function (api) {
api.addAssets([
'lib/assets/content/read_this_first.md',
'lib/assets/content/deploying.md', 'server',
'lib/assets/content/customizing.md', 'server',
'lib/assets/content/getting_help.md', 'server', 'server',
'lib/assets/content/removing_getting_started_posts.md', 'server',
'lib/assets/content/deploying.md',
'lib/assets/content/customizing.md',
'lib/assets/content/getting_help.md',
'lib/assets/content/removing_getting_started_posts.md',
], ['server']);
api.addFiles([