This commit is contained in:
@@ -32,6 +32,8 @@ todo: seeded user names look stupid with the numbers in them, change that so uni
|
||||
todo: Case 3595 Mass delete extension
|
||||
Do this early as it will be copied over and over again
|
||||
|
||||
todo: View on map bombs if nothing is filled in for the address / geocode
|
||||
should just do nothing
|
||||
|
||||
............................................................
|
||||
|
||||
|
||||
@@ -584,6 +584,21 @@ export default {
|
||||
return false;
|
||||
},
|
||||
///////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
stringIsNullOrEmpty: function(str) {
|
||||
if (str === null || str === undefined) {
|
||||
return true;
|
||||
}
|
||||
if (this.isString(str)) {
|
||||
if (str.trim() == "") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
///////////////////////////////////////////////
|
||||
// is Boolean replacement for lodash
|
||||
// https://stackoverflow.com/a/43718478/8939
|
||||
//
|
||||
@@ -654,13 +669,17 @@ export default {
|
||||
postCode: m.vm.obj.postCode
|
||||
}
|
||||
*/
|
||||
let hasGeo = obj.latitude || obj.longitude;
|
||||
console.log(obj);
|
||||
|
||||
|
||||
let hasGeo = obj.latitude && obj.longitude;
|
||||
|
||||
let hasAddress =
|
||||
obj.address ||
|
||||
obj.city ||
|
||||
objectHash.region ||
|
||||
obj.country ||
|
||||
obj.postCode;
|
||||
!this.stringIsNullOrEmpty(obj.address) &&
|
||||
!this.stringIsNullOrEmpty(obj.city) &&
|
||||
!this.stringIsNullOrEmpty(obj.region) &&
|
||||
!this.stringIsNullOrEmpty(obj.country) &&
|
||||
!this.stringIsNullOrEmpty(obj.postCode);
|
||||
|
||||
if (!hasGeo && !hasAddress) {
|
||||
throw new Error(
|
||||
|
||||
Reference in New Issue
Block a user