Skip to content

Commit

Permalink
not requiring coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
ashaban committed Jun 12, 2020
1 parent b86c383 commit 9c5f284
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions facility-recon-backend/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3099,29 +3099,11 @@ if (cluster.isMaster) {
populateData(headerMapping, data, 'Missing Facility ID', invalid);
rowMarkedInvalid = true;
}
// let invalidCharsFound = false;
// for (const char of data[headerMapping.code]) {
// if (char === '.' || char === '-') {
// continue;
// }
// if (char === '_') {
// invalidCharsFound = true
// break
// }
// let validate = /^\w+$/.test(char)
// if (!validate) {
// invalidCharsFound = true
// }
// }
// if (invalidCharsFound) {
// populateData(headerMapping, data, 'Invalid Characters In Facility ID, allowed chars are Aa-Zz, - and .', invalid);
// rowMarkedInvalid = true;
// }
if (!mixin.isFloat(data[headerMapping.lat]) && !mixin.isInt(data[headerMapping.lat])) {
if (data[headerMapping.lat] && !mixin.isFloat(data[headerMapping.lat]) && !mixin.isInt(data[headerMapping.lat])) {
populateData(headerMapping, data, 'Invalid Characters In latitude', invalid);
rowMarkedInvalid = true;
}
if (!mixin.isFloat(data[headerMapping.long]) && !mixin.isInt(data[headerMapping.long])) {
if (data[headerMapping.long] && !mixin.isFloat(data[headerMapping.long]) && !mixin.isInt(data[headerMapping.long])) {
populateData(headerMapping, data, 'Invalid Characters In longitude', invalid);
rowMarkedInvalid = true;
}
Expand Down

0 comments on commit 9c5f284

Please sign in to comment.