Updaated Products to have multiple associated stores.

- Products will be updated on first start of server to make sure the store attribute is set as an Array of values.
- You can edit Products to add more associated stores
- Products will list all associated stores on the product table view
- Cut down method calls to single event trigger for adding / editing products info
This commit is contained in:
Brian McGonagill 2024-08-13 10:48:27 -05:00
parent a7a9c48e01
commit 3f6618d906
4 changed files with 56 additions and 96 deletions

View file

@ -14,7 +14,7 @@ Products.allow({
Meteor.methods({
'add.product' (prodName, prodStore) {
check(prodName, String);
check(prodStore, String);
check(prodStore, [String]);
if (!this.userId) {
throw new Meteor.Error('You are not allowed to add products. Make sure you are logged in with valid user credentials.');
@ -29,7 +29,7 @@ Meteor.methods({
'edit.product' (prodId, prodName, prodStore) {
check(prodId, String);
check(prodName, String);
check(prodStore, String);
check(prodStore, [String]);
if (!this.userId) {
throw new Meteor.Error('You are not allowed to edit products. Make sure you are logged in with valid user credentials.');
@ -51,4 +51,4 @@ Meteor.methods({
return Products.remove({ _id: prodId });
}
});
});