2016-12-13 11:32:23 +09:00
|
|
|
import schema from './schema.js';
|
2016-11-22 18:14:51 -05:00
|
|
|
import mutations from './mutations.js';
|
|
|
|
import resolvers from './resolvers.js';
|
2016-12-18 19:04:11 +09:00
|
|
|
// import views from './views.js';
|
2017-03-23 16:27:59 +09:00
|
|
|
import { createCollection } from 'meteor/vulcan:core';
|
2016-06-23 12:17:39 +09:00
|
|
|
|
2016-11-22 18:14:51 -05:00
|
|
|
/**
|
|
|
|
* @summary The global namespace for Posts.
|
|
|
|
* @namespace Posts
|
|
|
|
*/
|
2016-12-12 10:24:34 +09:00
|
|
|
const Posts = createCollection({
|
2016-06-23 12:17:39 +09:00
|
|
|
|
2017-04-15 12:02:16 +09:00
|
|
|
collectionName: 'Posts',
|
2016-06-23 12:17:39 +09:00
|
|
|
|
2016-11-22 18:14:51 -05:00
|
|
|
typeName: 'Post',
|
|
|
|
|
|
|
|
schema,
|
|
|
|
|
|
|
|
resolvers,
|
|
|
|
|
|
|
|
mutations,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2017-04-15 12:02:16 +09:00
|
|
|
// refactor: moved here from schema.js
|
2016-11-22 18:14:51 -05:00
|
|
|
Posts.config = {};
|
|
|
|
|
|
|
|
Posts.config.STATUS_PENDING = 1;
|
|
|
|
Posts.config.STATUS_APPROVED = 2;
|
|
|
|
Posts.config.STATUS_REJECTED = 3;
|
|
|
|
Posts.config.STATUS_SPAM = 4;
|
|
|
|
Posts.config.STATUS_DELETED = 5;
|
|
|
|
|
|
|
|
|
2017-04-07 17:13:12 +09:00
|
|
|
/**
|
|
|
|
* @summary Posts statuses
|
|
|
|
* @type {Object}
|
|
|
|
*/
|
|
|
|
Posts.statuses = [
|
|
|
|
{
|
|
|
|
value: 1,
|
|
|
|
label: 'pending'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
value: 2,
|
|
|
|
label: 'approved'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
value: 3,
|
|
|
|
label: 'rejected'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
value: 4,
|
|
|
|
label: 'spam'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
value: 5,
|
|
|
|
label: 'deleted'
|
|
|
|
}
|
|
|
|
];
|
2016-11-22 18:14:51 -05:00
|
|
|
|
2017-04-07 17:13:12 +09:00
|
|
|
export default Posts;
|