mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
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:
parent
a7a9c48e01
commit
3f6618d906
4 changed files with 56 additions and 96 deletions
|
|
@ -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 });
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue