Changed FlagButton to use getErrorMessages util for failed flagging instead of custom messages

This commit is contained in:
PepeFranco
2017-10-10 12:55:32 -05:00
parent cecf2f4606
commit cf59bb213c
4 changed files with 4 additions and 8 deletions
@@ -8,6 +8,8 @@ import ClickOutside from 'coral-framework/components/ClickOutside';
import cn from 'classnames';
import styles from './styles.css';
import {getErrorMessages} from 'coral-framework/utils';
const name = 'talk-plugin-flags';
export default class FlagButton extends Component {
@@ -99,7 +101,7 @@ export default class FlagButton extends Component {
}
})
.catch((err) => {
this.props.notify('error', t('error.COMMENT_FLAG_FAILED'));
this.props.notify('error', getErrorMessages(err));
console.error(err);
});
} else {
@@ -110,7 +112,7 @@ export default class FlagButton extends Component {
}
})
.catch((err) => {
this.props.notify('error', t('error.USER_FLAG_FAILED'));
this.props.notify('error', getErrorMessages(err));
console.error(err);
});
}
-2
View File
@@ -206,8 +206,6 @@ en:
NOT_FOUND: "Resource not found"
ALREADY_EXISTS: "Resource already exists"
INVALID_ASSET_URL: "Assert URL is invalid"
COMMENT_FLAG_FAILED: "There was an issue reporting this comment"
COMMENT_USER_FAILED: "There was an issue reporting this user"
email: "Not a valid E-Mail"
confirm_password: "Passwords don't match. Please check again"
network_error: "Failed to connect to server. Check your internet connection and try again."
-2
View File
@@ -213,8 +213,6 @@ es:
username: "Los nombres pueden contener letras números y _"
USERNAME_IN_USE: "Este nombre ya está siendo usado."
USERNAME_REQUIRED: "Debe ingresar un nombre"
COMMENT_FLAG_FAILED: "Hubo un error reportando este comentario"
COMMENT_USER_FAILED: "Hubo un error reportando este usuario"
flag_comment: "Reportar este comentario"
flag_reason: "Razón por la que hacer este reporte (Opcional)"
flag_username: "Reportar el nombre de usuario"
-2
View File
@@ -215,8 +215,6 @@ pt_BR:
password: "A senha deve conter pelo menos 8 caracteres"
username: "Nomes de usuários podem conter números de letras e _ somente"
unexpected: "Ocorreu um erro inesperado. Desculpa!"
COMMENT_FLAG_FAILED: "Houve um problema relatando o comentário"
COMMENT_USER_FAILED: "Houve um problema relatando o usuário"
flag_comment: "Informe o comentário"
flag_reason: "Motivo do relatório (opcional)"
flag_username: "Informe o nome de usuário"