Many changes aded to system.
This commit is contained in:
parent
e0571d14b7
commit
5ba618f471
22 changed files with 640 additions and 57 deletions
38
client/LocationTypes/locationTypes.js
Normal file
38
client/LocationTypes/locationTypes.js
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import { Roles } from 'meteor/roles';
|
||||
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
|
||||
import { LocationTypes } from '../../imports/api/locationTypes.js';
|
||||
|
||||
Template.locationTypes.onCreated(function() {
|
||||
this.subscribe("LocationTypes");
|
||||
});
|
||||
|
||||
Template.locationTypes.onRendered(function() {
|
||||
|
||||
});
|
||||
|
||||
Template.locationTypes.helpers({
|
||||
|
||||
});
|
||||
|
||||
Template.locationTypes.events({
|
||||
'click #saveLocationType' (event) {
|
||||
event.preventDefault();
|
||||
|
||||
let typeName = $("#typeName").val();
|
||||
let typeDesc = $("#typeDesc").val();
|
||||
|
||||
if (typeName == null || typeName == "") {
|
||||
return;
|
||||
} else {
|
||||
const addLocation = async() => {
|
||||
const result = await Meteor.callAsync("add.locationType", typeName, typeDesc);
|
||||
if (!result) {
|
||||
showSnackbar("Location Type Failed!", "red");
|
||||
} else {
|
||||
showSnackbar("Location Type Added!", "green");
|
||||
}
|
||||
}
|
||||
addLocation();
|
||||
}
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue