LT-67: Validating server information with its schema
This commit is contained in:
parent
a057243745
commit
52770dc79c
@ -53,7 +53,16 @@ Template.serverInformationForm.onRendered(() => {
|
|||||||
Template.serverInformationForm.events({
|
Template.serverInformationForm.events({
|
||||||
submit(event, instance) {
|
submit(event, instance) {
|
||||||
event.preventDefault();
|
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) {
|
Meteor.call('serverSave', formData, function(error) {
|
||||||
if (error) {
|
if (error) {
|
||||||
// TODO: check for errors: not-authorized, data-write
|
// TODO: check for errors: not-authorized, data-write
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user