mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 12:36:39 -04:00

* Revert "add note link to issue in collection2 on mutation insert, remove debug console logs on mutation edit" This reverts commit7a15103de7
. * Revert "node simpl-schema + collection2-core: fix vote by specifying the right type of the array (dont use blackbox in the end!)" This reverts commite894c3224c
. * Revert "add graphql date type (fix problem with node simple schema), fix an update bug on date picker, add edit check on custom post item, add `blackbox: true` for arrays field (validation problem with simple-schema)" This reverts commit9d84fbec98
. * Revert "use node `simpl-schema` by aldeed to replace `meteor/aldeed:simple-schema` ; use the meteor collection2 core package as recommended" This reverts commit016935f4fa
. * revert before node-simple-schema, fix obj.hasOwnProperty undefined error thrown by simple-schema & collection2 * CustomPostsItem: check on renderActions; withDocument/List: pollInterval 20seconds by default; DateTime form component enhancement + GraphQLDate type
52 lines
952 B
JavaScript
52 lines
952 B
JavaScript
import Posts from "meteor/nova:posts";
|
|
import Users from "meteor/nova:users";
|
|
|
|
Users.addField([
|
|
/**
|
|
Count of the user's comments
|
|
*/
|
|
{
|
|
fieldName: "__commentCount",
|
|
fieldSchema: {
|
|
type: Number,
|
|
optional: true,
|
|
publish: true,
|
|
defaultValue: 0,
|
|
viewableBy: ['guests'],
|
|
}
|
|
}
|
|
]);
|
|
|
|
Posts.addField([
|
|
/**
|
|
Count of the post's comments
|
|
*/
|
|
{
|
|
fieldName: "commentCount",
|
|
fieldSchema: {
|
|
type: Number,
|
|
optional: true,
|
|
publish: true,
|
|
defaultValue: 0,
|
|
viewableBy: ['guests'],
|
|
}
|
|
},
|
|
/**
|
|
An array containing the `_id`s of commenters
|
|
*/
|
|
{
|
|
fieldName: "commenters",
|
|
fieldSchema: {
|
|
type: [String],
|
|
optional: true,
|
|
publish: true,
|
|
// join: {
|
|
// joinAs: "commentersArray",
|
|
// collection: () => Users,
|
|
// limit: 4
|
|
// },
|
|
resolveAs: 'commenters: [User]',
|
|
viewableBy: ['guests'],
|
|
}
|
|
}
|
|
]);
|