Just changes.

This commit is contained in:
Brian McGonagill 2026-01-27 12:42:20 -06:00
parent 5ba618f471
commit 8bd3fb1853
8 changed files with 214 additions and 13 deletions

View file

@ -12,5 +12,29 @@ Locations.allow({
});
Meteor.methods({
async 'add.location' (locName, locDesc, locTypeName, locTypeId, isChild, parentName, parentId) {
check(locName, String);
check(locDesc, String);
check(locTypeName, String);
check(locTypeId, String);
check(isChild, Boolean);
check(parentName, String);
check(parentId, String);
if (!this.userId) {
throw new Meteor.Error('You are not allowed to add locations. Make sure you are logged in with valid user credentials.');
}
return await Locations.insertAsync({
locationName: locName,
locationDesc: locDesc,
locationTypeName: locTypeName,
locationTypeId: locTypeId,
isChild: isChild,
parentName: parentName,
parentId: parentId,
addedOn: new Date(),
addedBy: this.userId,
});
},
});