diff --git a/modules/worker/back/models/department.js b/modules/worker/back/models/department.js index 5a927fc64..ff88a34d0 100644 --- a/modules/worker/back/models/department.js +++ b/modules/worker/back/models/department.js @@ -1,4 +1,11 @@ module.exports = Self => { + Self.validatesFormatOf('Email', { + message: 'Invalid email', + allowNull: true, + allowBlank: true, + with: /^[\W]*([\w+\-.%]+@[\w\-.]+\.[A-Za-z]{1,61}[\W]*,{1}[\W]*)*([\w+\-.%]+@[\w\-.]+\.[A-Za-z]{1,61})[\W]*$/ + }); + require('../methods/department/getLeaves')(Self); require('../methods/department/createChild')(Self); require('../methods/department/removeChild')(Self); diff --git a/modules/worker/front/department/basic-data/index.js b/modules/worker/front/department/basic-data/index.js index 000ef0597..e2df4804a 100644 --- a/modules/worker/front/department/basic-data/index.js +++ b/modules/worker/front/department/basic-data/index.js @@ -1,7 +1,6 @@ import ngModule from '../../module'; import Section from 'salix/components/section'; - ngModule.vnComponent('vnWorkerDepartmentBasicData', { template: require('./index.html'), controller: Section, diff --git a/modules/worker/front/department/descriptor/index.html b/modules/worker/front/department/descriptor/index.html index 3ef8f1887..ec8aebdbe 100644 --- a/modules/worker/front/department/descriptor/index.html +++ b/modules/worker/front/department/descriptor/index.html @@ -33,7 +33,7 @@