LT-67: Validating server information with its schema

This commit is contained in:
Bruno Alves de Faria 2016-08-31 10:17:46 -03:00
parent a057243745
commit 52770dc79c

View File

@ -53,7 +53,16 @@ Template.serverInformationForm.onRendered(() => {
Template.serverInformationForm.events({
submit(event, instance) {
event.preventDefault();
var formData = instance.data.form.value();
// Stop here if the form validation fails
if (!instance.data.form.validate()) {
return;
}
// Get the current form data
const formData = instance.data.form.value();
// Call the save method
Meteor.call('serverSave', formData, function(error) {
if (error) {
// TODO: check for errors: not-authorized, data-write