Rename notice -> announcement

This commit is contained in:
nztqa 2017-10-01 12:43:15 +09:00
parent aa1876f94c
commit a88ac6113e
9 changed files with 39 additions and 39 deletions

View file

@ -1,36 +0,0 @@
Notices = new Mongo.Collection('notices');
Notices.attachSchema(new SimpleSchema({
enabled: {
type: Boolean,
defaultValue: false,
},
title: {
type: String,
optional: true,
},
body: {
type: String,
optional: true,
},
sort: {
type: Number,
decimal: true,
},
}));
Notices.allow({
update(userId) {
const user = Users.findOne(userId);
return user && user.isAdmin;
},
});
if (Meteor.isServer) {
Meteor.startup(() => {
const notices = Notices.findOne({});
if(!notices){
Notices.insert({enabled: false, sort: 0});
}
});
}