mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +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",
|
"name": "@hydrooj/ui-default",
|
||||||
"version": "4.11.12",
|
"version": "4.11.13",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"main": "hydro.js",
|
"main": "hydro.js",
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import i18n from 'vj/utils/i18n';
|
|||||||
import { ConfirmDialog } from 'vj/components/dialog';
|
import { ConfirmDialog } from 'vj/components/dialog';
|
||||||
import Dropdown from 'vj/components/dropdown/Dropdown';
|
import Dropdown from 'vj/components/dropdown/Dropdown';
|
||||||
import Editor from 'vj/components/editor/index';
|
import Editor from 'vj/components/editor/index';
|
||||||
|
import Notification from 'vj/components/notification';
|
||||||
|
|
||||||
const categories = {};
|
const categories = {};
|
||||||
const dirtyCategories = [];
|
const dirtyCategories = [];
|
||||||
@@ -153,6 +154,8 @@ export default new NamedPage(['problem_create', 'problem_edit'], (pagename) => {
|
|||||||
if (confirmed) {
|
if (confirmed) {
|
||||||
return request.post('.', { operation: 'delete' }).then((res) => {
|
return request.post('.', { operation: 'delete' }).then((res) => {
|
||||||
window.location.href = res.url;
|
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.';
|
const message = 'Confirm deleting this problem? Its files, submissions, discussions and solutions will be deleted as well.';
|
||||||
|
|||||||
Reference in new issue
Block a user