Skip to content

Commit

Permalink
RDISCROWD-7917 - support improved flash message for error
Browse files Browse the repository at this point in the history
  • Loading branch information
peterkle committed Jan 30, 2025
1 parent 806188f commit ce584c6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion static/src/components/setting/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ export default {
async save () {
let data = {};
let errormsg = '';
if (this.dataAccessConfigured && this.validAccessLevels.length > 0) {
data = {
config: this.externalConfigDict,
Expand Down Expand Up @@ -352,6 +353,7 @@ export default {
const projectData = await projectRes.json();
if (projectData['status'] !== 'success') {
validConfig = false;
errormsg = projectData['error_msg'];
window.pybossaNotify(projectData['flash'], true, projectData['status']);
}
}
Expand All @@ -378,7 +380,11 @@ export default {
if (validConfig) {
window.pybossaNotify('Configuration updated successfully', true, 'success');
} else {
window.pybossaNotify('An error occurred configuring project config.', true, 'error');
if (errormsg) {
window.pybossaNotify(errormsg, true, 'error');
} else {
window.pybossaNotify('An error occurred configuring project config.', true, 'error');
}
}
} catch (error) {
window.pybossaNotify('An error occurred configuring project config.', true, 'error');
Expand Down

0 comments on commit ce584c6

Please sign in to comment.