diff --git a/client/AdminMgmt/ProductMgmt/prodMgmtForm.js b/client/AdminMgmt/ProductMgmt/prodMgmtForm.js index 5ee61e7..7a355a6 100644 --- a/client/AdminMgmt/ProductMgmt/prodMgmtForm.js +++ b/client/AdminMgmt/ProductMgmt/prodMgmtForm.js @@ -4,8 +4,6 @@ import { Stores } from '../../../imports/api/stores.js'; Template.prodMgmtForm.onCreated(function() { this.subscribe("myProducts"); this.subscribe("storeInfo"); - this.subscribe("myCategories"); - this.subscribe("myLocations"); }); Template.prodMgmtForm.onRendered(function() { @@ -58,17 +56,8 @@ Template.prodMgmtForm.events({ 'click .editProdMgmt' (event) { event.preventDefault(); let name = $("#prodName").val(); - - let location = $("#prodLocation").val(); let prodId = Session.get("prodEditId"); - - if (cat == null) { - cat = ""; - } - - if (location == null) { - location = ""; - } + let store = $("#prodStore").val(); if (store == null) { store = ""; @@ -78,7 +67,7 @@ Template.prodMgmtForm.events({ Session.set("prodNameRed", true); return; } else { - Meteor.call('edit.product', prodId, name, cat, store, location, function(err, result) { + Meteor.call('edit.product', prodId, name, store, function(err, result) { if (err) { // console.log(" ERROR: can't add product: " + err); } else { @@ -99,13 +88,6 @@ Template.prodMgmtForm.events({ let prodId = Session.get("prodEditId"); let prodEditMode = Session.get("prodEditMode"); console.log(" ---- got the submit event for products."); - if (cat == null) { - cat = ""; - } - - if (location == null) { - location = ""; - } if (store == null) { store = ""; @@ -116,7 +98,7 @@ Template.prodMgmtForm.events({ return; } else { if (prodEditMode == true) { - Meteor.call('edit.product', prodId, name, cat, store, location, function(err, result) { + Meteor.call('edit.product', prodId, name, store, function(err, result) { if (err) { // console.log(" ERROR: can't add product: " + err); } else { @@ -127,7 +109,7 @@ Template.prodMgmtForm.events({ } }); } else { - Meteor.call('add.product', name, cat, store, location, function(err, result) { + Meteor.call('add.product', name, store, function(err, result) { if (err) { // console.log(" ERROR: can't add product: " + err); } else {