mirror of
https://github.com/vale981/Vulcan
synced 2025-03-09 12:16:37 -04:00

* Telescope.notifications.create -> import { createNotifications } from 'meteor/nova:notifications' ; * leverage Meteor's weak dependencies on packages & move code related to emails / notifications from nova:posts et al. to nova:notifications
82 lines
1.6 KiB
JavaScript
82 lines
1.6 KiB
JavaScript
import Users from "meteor/nova:users";
|
|
|
|
// note: leverage weak dependencies on packages
|
|
const Posts = Package['nova:posts'] ? Package['nova:posts'].default : null;
|
|
const Categories = Package['nova:categories'] ? Package['nova:categories'].default : null;
|
|
|
|
Users.addField([
|
|
{
|
|
fieldName: 'subscribedItems',
|
|
fieldSchema: {
|
|
type: Object,
|
|
optional: true,
|
|
blackbox: true,
|
|
hidden: true, // never show this
|
|
preload: true,
|
|
}
|
|
},
|
|
{
|
|
fieldName: 'subscribers',
|
|
fieldSchema: {
|
|
type: [String],
|
|
optional: true,
|
|
hidden: true, // never show this,
|
|
}
|
|
},
|
|
{
|
|
fieldName: 'subscriberCount',
|
|
fieldSchema: {
|
|
type: Number,
|
|
optional: true,
|
|
hidden: true, // never show this
|
|
}
|
|
}
|
|
]);
|
|
|
|
// check if nova:posts exists, if yes, add the custom fields to Posts
|
|
if (!!Posts) {
|
|
|
|
Posts.addField([
|
|
{
|
|
fieldName: 'subscribers',
|
|
fieldSchema: {
|
|
type: [String],
|
|
optional: true,
|
|
hidden: true, // never show this
|
|
}
|
|
},
|
|
{
|
|
fieldName: 'subscriberCount',
|
|
fieldSchema: {
|
|
type: Number,
|
|
optional: true,
|
|
hidden: true, // never show this
|
|
}
|
|
}
|
|
]);
|
|
|
|
}
|
|
|
|
// check if nova:categories exists, if yes, add the custom fields to Categories
|
|
if (!!Categories) {
|
|
|
|
Categories.addField([
|
|
{
|
|
fieldName: 'subscribers',
|
|
fieldSchema: {
|
|
type: [String],
|
|
optional: true,
|
|
hidden: true, // never show this
|
|
}
|
|
},
|
|
{
|
|
fieldName: 'subscriberCount',
|
|
fieldSchema: {
|
|
type: Number,
|
|
optional: true,
|
|
hidden: true, // never show this
|
|
}
|
|
}
|
|
]);
|
|
|
|
}
|