Many changes aded to system.

This commit is contained in:
Brian McGonagill 2026-01-24 13:49:38 -06:00
parent e0571d14b7
commit 5ba618f471
22 changed files with 640 additions and 57 deletions

28
imports/api/assets.js Normal file
View file

@ -0,0 +1,28 @@
import { Meteor } from 'meteor/meteor';
import { Mongo } from 'meteor/mongo';
import { check } from 'meteor/check';
export const Assets = new Mongo.Collection('assets');
Assets.allow({
insert: function(userId, doc){
// if use id exists, allow insert
return !!userId;
},
});
Meteor.methods({
async 'add.asset' (assetName {
check(assetName, String);
if (!this.userId) {
throw new Meteor.Error('You are not allowed to add assets. Make sure you are logged in with valid user credentials.');
}
return await Assets.insertAsync({
assetName: assetName,
tenant_id: "000000",
});
},
});