29 lines
575 B
JavaScript
29 lines
575 B
JavaScript
import { check } from 'meteor/check';
|
|
|
|
let collection = new Mongo.Collection(null);
|
|
|
|
function findById(notificationId) {
|
|
check(notificationId, String);
|
|
collection.find({ notificationId });
|
|
}
|
|
|
|
function add(notification) {
|
|
check(notification.notification, String);
|
|
collection.insert(notification);
|
|
}
|
|
|
|
function remove(notificationId) {
|
|
check(notificationId, String);
|
|
collection.remove({ notificationId });
|
|
}
|
|
|
|
const NotificationCollection = {findById, add, remove,};
|
|
|
|
export default NotificationCollection;
|
|
|
|
export {
|
|
findById,
|
|
add,
|
|
remove,
|
|
};
|