Prototyped the barcode idea; Added a basic production system.
This commit is contained in:
@@ -3,7 +3,7 @@ import { Mongo } from 'meteor/mongo';
|
||||
import { check } from 'meteor/check';
|
||||
import {SimpleSchema} from 'meteor/aldeed:simple-schema';
|
||||
|
||||
Workers = new Mongo.Collection('Workers');
|
||||
let Workers = new Mongo.Collection('Workers');
|
||||
let WORKER_ACTIVITIES = ['sales', 'prep', 'canning', 'farming'];
|
||||
let workersSchema = new SimpleSchema({
|
||||
name: {
|
||||
@@ -60,7 +60,7 @@ let workersSchema = new SimpleSchema({
|
||||
workersSchema.constants = {activities: WORKER_ACTIVITIES};
|
||||
Workers.attachSchema(workersSchema);
|
||||
|
||||
if(Meteor.isServer) Meteor.publish('Workers', function() {
|
||||
if(Meteor.isServer) Meteor.publish('workers', function() {
|
||||
return Workers.find({});
|
||||
});
|
||||
|
||||
@@ -122,4 +122,11 @@ if(Meteor.isServer) {
|
||||
});
|
||||
}
|
||||
|
||||
//Allows the client to do DB interaction without calling server side methods, while still retaining control over whether the user can make changes.
|
||||
Workers.allow({
|
||||
insert: function() {return false;},
|
||||
update: function() {return false;},
|
||||
remove: function() {return false;}
|
||||
});
|
||||
|
||||
export default Workers;
|
||||
Reference in New Issue
Block a user