mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 07:09:48 +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
32fd913ac3
commit
4498b4624a
@ -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