Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: error message changed when code has been already applied #871

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions components/forms/ApplyCodeForm.tsx
Expand Up @@ -78,6 +78,9 @@ const ApplyCodeForm = () => {
PARTNER_ACCESS_CODE_STATUS.INVALID_CODE
) {
setFormError(t('form.codeErrors.invalid'));
} else if (error === PARTNER_ACCESS_CODE_STATUS.ALREADY_APPIED) {

setFormError(t('form.codeErrors.codeAlreadyApplied'));
} else {
setFormError(
t.rich('form.codeErrors.internal', {
Expand Down
1 change: 1 addition & 0 deletions constants/enums.ts
Expand Up @@ -23,6 +23,7 @@ export enum PARTNER_ACCESS_CODE_STATUS {
DOES_NOT_EXIST = 'DOES_NOT_EXIST',
ALREADY_IN_USE = 'ALREADY_IN_USE',
CODE_EXPIRED = 'CODE_EXPIRED',
ALREADY_APPIED = 'PARTNER_ACCESS_CODE_STATUS'
}

export enum WHATSAPP_SUBSCRIPTION_STATUS {
Expand Down
1 change: 1 addition & 0 deletions messages/auth/en.json
Expand Up @@ -38,6 +38,7 @@
"codeErrors": {
"internal": "There was an error validating your access code. Try again later and <contactLink>message the Bloom team</contactLink> if you're still getting this error.",
"expired": "This code has expired. Get in touch with the {partnerName} team.",
"codeAlreadyApplied":"This code has already been applied to your account",
"invalid": "Your access code appears to be invalid. Check for typos or get in touch with the {partnerName} team.",
"alreadyInUse": "This code has already been used. If you think there's been a mistake, get in touch with the {partnerName} team."
},
Expand Down
2 changes: 2 additions & 0 deletions messages/auth/es.json
Expand Up @@ -36,6 +36,8 @@
"codeErrors": {
"internal": "Hubo un error validando tu código de acceso. Inténtalo de nuevo luego y <contactLink>envíale un mensaje al equipo de Bloom</contactLink> si sigues obteniendo este error.",
"expired": "Este código ha expirado. Ponte en contacto con el equipo de {partnerName}.",
"codeAlreadyApplied":"Este código ya ha sido aplicado a tu cuenta",

"invalid": "Este código parece no ser válido. Revisa si tienes errores tipográficos o ponte en contacto con el equipo de {partnerName}.",
"alreadyInUse": "Este código ya ha sido usado. Si crees que esto es un error, ponte en contacto con el equipo de {partnerName}."
},
Expand Down