Skip to content

Commit

Permalink
When "tags written" is displayed, make it a good (green) message.
Browse files Browse the repository at this point in the history
  • Loading branch information
pstaabp committed Oct 22, 2023
1 parent ab7cfef commit 5d072e9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion htdocs/js/TagWidget/tagwidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@
}

async savetags() {
console.log('in savettags');
const response = await fetch(webServiceURL, {
method: 'post',
mode: 'same-origin',
Expand All @@ -313,11 +314,12 @@
})
)
}).catch((err) => `Error saving problem tags: ${err.message ?? err}`);
console.log(response);
if (typeof response === 'string') return showMessage(response);
if (!response.ok) return showMessage('Unable to save problem tags.');
const data = await response.json();
if (data.error) return showMessage(data.error);
showMessage(data.server_response);
showMessage(data.server_response, true);
}
}

Expand Down

0 comments on commit 5d072e9

Please sign in to comment.