Added new models. Major changes to the table widget. Still has problems with the editing in the table widget.

This commit is contained in:
2022-06-13 07:42:26 -07:00
parent 11fbfcfac0
commit 69ca0d5eb6
15 changed files with 417 additions and 16578 deletions

24
imports/api/rooms.js Normal file
View File

@@ -0,0 +1,24 @@
import {Mongo} from "meteor/mongo";
import {Meteor} from "meteor/meteor";
export const Rooms = new Mongo.Collection('rooms');
if (Meteor.isServer) {
// This code only runs on the server
Meteor.publish('rooms', function(siteId) {
return Rooms.find({siteId});
});
}
Meteor.methods({
'rooms.add'(name, siteId) {
if(Roles.userIsInRole(Meteor.userId(), "admin", {anyScope:true})) {
Rooms.insert({name, siteId});
}
},
'rooms.remove'(_id) {
if(Roles.userIsInRole(Meteor.userId(), "admin", {anyScope:true})) {
//TODO: Need to first verify there are no checked out assets to the room.
}
},
});