mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
ui: problem_edit: show notification when error
This commit is contained in:
1 parent
7dc88889c3
commit
392de5c6e1
2 files changed
+4
-1
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/ui-default",
|
||||
"version": "4.11.12",
|
||||
"version": "4.11.13",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"license": "AGPL-3.0",
|
||||
"main": "hydro.js",
|
||||
|
||||
@@ -6,6 +6,7 @@ import i18n from 'vj/utils/i18n';
|
||||
import { ConfirmDialog } from 'vj/components/dialog';
|
||||
import Dropdown from 'vj/components/dropdown/Dropdown';
|
||||
import Editor from 'vj/components/editor/index';
|
||||
import Notification from 'vj/components/notification';
|
||||
|
||||
const categories = {};
|
||||
const dirtyCategories = [];
|
||||
@@ -153,6 +154,8 @@ export default new NamedPage(['problem_create', 'problem_edit'], (pagename) => {
|
||||
if (confirmed) {
|
||||
return request.post('.', { operation: 'delete' }).then((res) => {
|
||||
window.location.href = res.url;
|
||||
}).catch((e) => {
|
||||
Notification.error(e.message);
|
||||
});
|
||||
}
|
||||
const message = 'Confirm deleting this problem? Its files, submissions, discussions and solutions will be deleted as well.';
|
||||
|
||||
Reference in new issue
Block a user