Skip to content
Snippets Groups Projects
Commit b01211c8 authored by Sebastian Pongratz's avatar Sebastian Pongratz :ping_pong: Committed by Sebastian Listl
Browse files

#1072334 validierung website

parent 2c9d35fd
No related branches found
No related tags found
No related merge requests found
......@@ -43,10 +43,10 @@ if(vars.get("$local.value"))
};
var getRowsConfig = entities.createConfigForLoadingRows()
.entity("AddressValidation_entity")
.provider("FullAddressValidation")
.fields(["CITY", "ZIP", "STREET"])
.addParameter("CurrentValue_param", response.address);
.entity("AddressValidation_entity")
.provider("FullAddressValidation")
.fields(["CITY", "ZIP", "STREET"])
.addParameter("CurrentValue_param", response.address);
var rows = entities.getRows(getRowsConfig);
......@@ -103,7 +103,7 @@ if(vars.get("$local.value"))
{
neon.addRecord("Communications", {
"MEDIUM_ID" : $KeywordRegistry.communicationMedium$linkedin(),
"ADDR" : response.linkedInUrl
"ADDR" : _formatLinkaddress(response.linkedInUrl)
});
}
......@@ -111,7 +111,7 @@ if(vars.get("$local.value"))
{
neon.addRecord("Communications", {
"MEDIUM_ID" : $KeywordRegistry.communicationMedium$internet(),
"ADDR" : response.website
"ADDR" : _formatLinkaddress(response.website)
});
}
......@@ -121,4 +121,19 @@ if(vars.get("$local.value"))
if(response.lastName) neon.setFieldValue("$field.LASTNAME", response.lastName);
}
}
/**
* Adds "https://" if the address begins not with it or with "http://".
*
* @param {String} [pAddr] the link
* @return {String}
*/
function _formatLinkaddress (pAddr)
{
if (!pAddr.startsWith("https://") && !pAddr.startsWith("http://"))
{
return ("https://" + pAddr).toString();
}
return pAddr.toString();
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment