mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
Fixed label serialization in members bulk importer
no issue - After a refactor logic was missing trimming logic and handling for empty labels
This commit is contained in:
parent
7dc70f5607
commit
f928b68ee3
@ -140,8 +140,8 @@ function serializeMemberLabels(labels) {
|
||||
if (typeof label !== 'string') {
|
||||
return labelsAcc.concat(label.name);
|
||||
}
|
||||
return labelsAcc.concat(label);
|
||||
});
|
||||
return labelsAcc.concat(label.trim());
|
||||
}, []);
|
||||
}
|
||||
|
||||
function getMemberData({members, allLabelModels, importSetLabels, createdBy}) {
|
||||
@ -213,7 +213,9 @@ function getMemberData({members, allLabelModels, importSetLabels, createdBy}) {
|
||||
};
|
||||
membersToInsert.push(memberToInsert);
|
||||
|
||||
const memberLabels = serializeMemberLabels((member.labels || '').split(','));
|
||||
const memberLabels = member.labels
|
||||
? serializeMemberLabels((member.labels || '').split(','))
|
||||
: [];
|
||||
const allLabels = _.union(memberLabels, importedLabels);
|
||||
|
||||
const memberLabelAssociationsToInsert = allLabels.map((label, index) => {
|
||||
|
Loading…
Reference in New Issue
Block a user