-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from nci-ats/dev
Pull from dev into master for end of sprint 1
- Loading branch information
Showing
33 changed files
with
2,471 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,6 @@ jspm_packages | |
# Optional REPL history | ||
.node_repl_history | ||
.DS_Store | ||
|
||
# Lint Settings | ||
.eslintrc.json* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ get.all = function(req,res){ | |
"commercial":{ | ||
"outfitters": outfitter | ||
} | ||
} | ||
}; | ||
|
||
return commercial; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
controllers/permits/special-uses/commercial/outfitters/validate.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
___ ___ ___ _ _ _ ___ ___ | ||
| __/ __| ___| _ \___ _ _ _ __ (_) |_ /_\ | _ \_ _| | ||
| _|\__ \ / -_) _/ -_) '_| ' \| | _| / _ \| _/| | | ||
|_| |___/ \___|_| \___|_| |_|_|_|_|\__| /_/ \_\_| |___| | ||
*/ | ||
|
||
//******************************************************************* | ||
|
||
'use strict'; | ||
|
||
//******************************************************************* | ||
|
||
var outfitters = function(req){ | ||
|
||
var output = { | ||
'fields_valid': true, | ||
'error_array':[] | ||
}; | ||
if(!req.body['applicant-info'].orgType){ | ||
output.fields_valid = false; | ||
output.error_array.push('orgType'); | ||
} | ||
if (!req.body['temp-outfitter-fields'].activityDescription) { | ||
output.fields_valid = false; | ||
output.error_array.push('activityDescription'); | ||
} | ||
if (!req.body['temp-outfitter-fields'].locationDescription) { | ||
output.fields_valid = false; | ||
output.error_array.push('locationDescription'); | ||
} | ||
if (!req.body['temp-outfitter-fields'].startDateTime) { | ||
output.fields_valid = false; | ||
output.error_array.push('startDateTime'); | ||
} | ||
if (!req.body['temp-outfitter-fields'].endDateTime) { | ||
output.fields_valid = false; | ||
output.error_array.push('endDateTime'); | ||
} | ||
|
||
var files_res = validate_files(req); | ||
output.fields_valid = output.fields_valid && files_res.fields_valid; | ||
output.error_array = output.error_array.concat(files_res.error_array); | ||
|
||
return output; | ||
}; | ||
|
||
function validate_files (req){ | ||
|
||
var output = { | ||
'fields_valid': true, | ||
'error_array':[] | ||
}; | ||
|
||
if (!req.body['temp-outfitter-fields'].insuranceCertificate) { | ||
output.fields_valid = false; | ||
output.error_array.push('insuranceCertificate'); | ||
} | ||
if (!req.body['temp-outfitter-fields'].goodStandingEvidence) { | ||
output.fields_valid = false; | ||
output.error_array.push('goodStandingEvidence'); | ||
} | ||
if (!req.body['temp-outfitter-fields'].operatingPlan) { | ||
output.fields_valid = false; | ||
output.error_array.push('operatingPlan'); | ||
} | ||
|
||
return output; | ||
} | ||
|
||
//******************************************************************* | ||
// exports | ||
|
||
module.exports.outfitters = outfitters; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.