mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 08:18:50 +00:00
Lots of changes and additions to the project. Still early, and not usable.
This commit is contained in:
parent
8636f8cf9b
commit
266dbd0856
41 changed files with 836 additions and 67 deletions
35
client/AdminMgmt/StoreMgMt/storeMgmtForm.js
Normal file
35
client/AdminMgmt/StoreMgMt/storeMgmtForm.js
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import { Stores } from '../../../imports/api/stores';
|
||||
|
||||
Template.storeMgmtForm.onCreated(function() {
|
||||
this.subscribe("storeInfo");
|
||||
});
|
||||
|
||||
Template.storeMgmtForm.onRendered(function() {
|
||||
Session.set("borderRed", false);
|
||||
});
|
||||
|
||||
Template.storeMgmtForm.helpers({
|
||||
|
||||
});
|
||||
|
||||
Template.storeMgmtForm.events({
|
||||
'click .saveStoreMgmt' (event) {
|
||||
event.preventDefault();
|
||||
let storeName = $("#storeName").val();
|
||||
let storeType = $("#storeType").val();
|
||||
if (storeName == "" || storeName == null) {
|
||||
Session.set("borderRed", true);
|
||||
return;
|
||||
} else {
|
||||
Meteor.call("add.store", storeName, storeType, function(err, result) {
|
||||
if (err) {
|
||||
// console.log("ERROR: Store add failed: " + err);
|
||||
} else {
|
||||
// console.log("Success adding store!");
|
||||
$("#storeName").val("");
|
||||
$("#storeType").val("");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue