Skip to content

Commit

Permalink
CIWEMB-435: Allow having two custom fields with the same name
Browse files Browse the repository at this point in the history
  • Loading branch information
omarabuhussein committed Nov 9, 2023
1 parent ed36ea8 commit e21ceb4
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,15 @@

return _.map(angular.copy(activitiesData), function (activity) {
var applicantReviewFields = {};
activity['api.CustomValue.gettreevalues'].values.map(function (field) {
applicantReviewFields = Object.assign(applicantReviewFields, field.fields);
activity['api.CustomValue.gettreevalues'].values.map(function (fieldSet) {
Object.keys(fieldSet.fields).forEach(function (key) {
var field = fieldSet.fields[key];
var newKey = key + field.id;
fieldSet.fields[newKey] = Object.assign({ id: field.id }, field);
delete fieldSet.fields[key];
});

applicantReviewFields = Object.assign(applicantReviewFields, fieldSet.fields);
});

activity.status_label = activity['api.OptionValue.getsingle'].label;
Expand Down

0 comments on commit e21ceb4

Please sign in to comment.