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

Validation exception msg id 193 #195

Merged
merged 2 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/actions/RecordActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,11 @@ export function createRecord(record) {
})
.catch((error) => {
dispatch(saveRecordError(error.response.data, record, ACTION_FLAG.CREATE_ENTITY));
const errorMessageText =
getState().intl.messages[error.response.data.messageId] || error.response.data || "An error occurred";
dispatch(publishMessage(errorMessage("record.save-error", { error: errorMessageText })));
dispatch(
publishMessage(
errorMessage("record.save-error", { error: getState().intl.messages[error.response.data.messageId] }),
),
);
});
};
}
Expand Down
1 change: 1 addition & 0 deletions src/i18n/cs.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ export default {
"record.last-edited-msg": "Naposledy upravil(a) {name} {date}.",
"record.save-success": "Záznam úspěšně uložen.",
"record.save-error": "Záznam se nepodařilo uložit. {error}",
"record.save-error.user-not-assigned-to-institution": "Uživatel není přiřazen k žádné instituci.",
"record.form.please-wait": "Nahrávám formulář, prosím, čekejte...",
"record.delete-success": "Záznam úspěšně odstraněn",
"record.delete-error": "Záznam se nepodařilo smazat. {error}",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ export default {
"record.last-edited-msg": "Last modified {date} by {name}.",
"record.save-success": "Form successfully saved.",
"record.save-error": "Unable to save record. {error}",
"record.save-error.user-not-assigned-to-institution": "User is not assigned to any institution.",
"record.form.please-wait": "Loading form, please wait...",
"record.delete-success": "Form deleted successfully",
"record.delete-error": "Unable to delete record. {error}",
Expand Down
Loading