1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-03 16:10:26 +00:00

Improve response catch module (#3848)

* add err hanlder for dialog ajax request

* add error handler for component ajax request

* repair code bug

* repair code bug

* add handler for page ajax module
This commit is contained in:
杨顺强
2019-07-16 10:01:09 +08:00
committed by Daniel Pan
parent 957979254b
commit 04e791f14c
91 changed files with 813 additions and 327 deletions

View File

@@ -20,6 +20,7 @@ import Rename from '../../components/dialog/rename-grid-item-dialog';
import CreateFile from '../dialog/create-file-dialog';
import CreateFolder from '../dialog/create-folder-dialog';
import LibSubFolderPermissionDialog from '../dialog/lib-sub-folder-permission-dialog';
import toaster from '../toast';
import '../../css/grid-view.css';
@@ -241,7 +242,10 @@ class DirentGridView extends React.Component{
this.props.updateDirent(currentObject, 'locked_by_me', true);
let lockName = username.split('@');
this.props.updateDirent(currentObject, 'lock_owner_name', lockName[0]);
});
}).catch(error => {
let errMessage = Utils.getErrorMsg(error);
toaster.danger(errMessage);
})
}
onUnlockItem = (currentObject) => {
@@ -251,6 +255,9 @@ class DirentGridView extends React.Component{
this.props.updateDirent(currentObject, 'is_locked', false);
this.props.updateDirent(currentObject, 'locked_by_me', false);
this.props.updateDirent(currentObject, 'lock_owner_name', '');
}).catch(error => {
let errMessage = Utils.getErrorMsg(error);
toaster.danger(errMessage);
});
}