Skip to content
This repository has been archived by the owner on Jan 25, 2025. It is now read-only.

Commit

Permalink
Adding prefix on save. Do we really need to do this?
Browse files Browse the repository at this point in the history
  • Loading branch information
ceiroa committed Nov 3, 2015
1 parent 12523cf commit d98ea1d
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/aura/STG_CMP_Affl/STG_CMP_AfflHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,21 @@
saveAfflSettings : function(component) {
var saveAction = component.get("c.saveAfflMappings");
var settings = component.get("v.afflMappings");
var settings_w_prefix = {};
//Add package prefix to each custom field
for(var key in settings) {
if(key.endsWith('__c')) {
var key_w_prefix = namespace_prefix + key;
settings_w_prefix[key_w_prefix] = settings[key];
} else {
settings_w_prefix[key] = settings[key];
if(namespace_prefix && namespace_prefix.length > 0) {
var settings_w_prefix = {};
//Add package prefix to each custom field
for(var key in settings) {
if(key.endsWith('__c')) {
var key_w_prefix = namespace_prefix + key;
settings_w_prefix[key_w_prefix] = settings[key];
} else {
settings_w_prefix[key] = settings[key];
}
}
saveAction.setParams({"afflMappings" : settings_w_prefix});
} else {
saveAction.setParams({"afflMappings" : settings});
}
saveAction.setParams({"afflMappings" : settings_w_prefix});
saveAction.setCallback(this, function(response) {
if(response.getState() === "ERROR") {
this.displayError(response);
Expand Down

0 comments on commit d98ea1d

Please sign in to comment.