Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let errors = [];
- if (!isValidApplicationId(appId)) {
- errors.push({ valid: false, name: "appId", app_id: appId, message: 'Application ID is not valid; it must only contain lower case characters, 0-9, - and _, and be between 4 and 50 characters long.' });
- }
- if (!isValidApplicationName(appName))
- errors.push({ valid: false, name: "appName", app_name: appName, message: 'Application Name is not valid; It must not contain special characters. List:!"#$%&()*+,-./:;<=>?@[\]^_`{|}~' });
- if (Array.isArray(errors) && errors.length) {
- return res.json(errors);
- }
- data.forEach(item => {
- if (item.name === 'appName') {
- $('#errorAppname').text(item.message);
- }
- if (item.name === 'appId') {
- $('#errorAppid').text(item.message);
- }
- });
- if ( data.length === 0 ) {
- $('#new_app_form').submit();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement