1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-20 02:48:51 +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

@@ -1,9 +1,10 @@
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import { DropdownToggle, Dropdown, DropdownMenu, DropdownItem, Tooltip} from 'reactstrap';
import { Utils } from '../../utils/utils';
import { gettext, siteRoot, canGenerateShareLink, isDocs } from '../../utils/constants';
import { seafileAPI } from '../../utils/seafile-api';
import { Utils } from '../../utils/utils';
import toaster from '../toast';
import ModalPotal from '../modal-portal';
import ShareDialog from '../dialog/share-dialog';
import EditFileTagDialog from '../dialog/edit-filetag-dialog';
@@ -52,6 +53,9 @@ class ViewFileToolbar extends React.Component {
let { path, repoID } = this.props;
seafileAPI.createDraft(repoID, path).then(res => {
window.location.href = siteRoot + 'lib/' + res.data.origin_repo_id + '/file' + res.data.draft_file_path + '?mode=edit';
}).catch(error => {
let errMessage = Utils.getErrorMsg(error);
toaster.danger(errMessage);
});
}