mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-29 13:52:10 +03:00
Fixed grouping error in members CSV importer
no issue - Import error grouping wasn't working correctly when error didn't have defined context property - The copy will be refined in final design review
This commit is contained in:
parent
51d506469d
commit
097ff9fba9
@ -225,7 +225,10 @@ const members = {
|
||||
return decorateWithSubscriptions(member);
|
||||
} catch (error) {
|
||||
if (error.code && error.message.toLowerCase().indexOf('unique') !== -1) {
|
||||
throw new errors.ValidationError({message: i18n.t('errors.api.members.memberAlreadyExists')});
|
||||
throw new errors.ValidationError({
|
||||
message: i18n.t('errors.api.members.memberAlreadyExists.message'),
|
||||
context: i18n.t('errors.api.members.memberAlreadyExists.context')
|
||||
});
|
||||
}
|
||||
|
||||
// NOTE: failed to link Stripe customer/plan/subscription
|
||||
@ -482,7 +485,7 @@ const members = {
|
||||
}).then(() => {
|
||||
// NOTE: grouping by context because messages can contain unique data like "customer_id"
|
||||
const groupedErrors = _.groupBy(invalid.errors, 'context');
|
||||
const uniqueErrors = _.uniq(invalid.errors, 'context');
|
||||
const uniqueErrors = _.uniqBy(invalid.errors, 'context');
|
||||
|
||||
const outputErrors = uniqueErrors.map((error) => {
|
||||
let errorGroup = groupedErrors[error.context];
|
||||
|
@ -368,7 +368,10 @@
|
||||
},
|
||||
"members": {
|
||||
"memberNotFound": "Member not found.",
|
||||
"memberAlreadyExists": "Email address is already member.",
|
||||
"memberAlreadyExists": {
|
||||
"message": "Email address is already member.",
|
||||
"context": "Attempting to add member with existing email address."
|
||||
},
|
||||
"stripeNotConnected": {
|
||||
"message": "Member not imported, Stripe account missing",
|
||||
"context": "Attempting to import members with Stripe data when there is no Stripe account connected",
|
||||
|
Loading…
Reference in New Issue
Block a user