1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-11 11:51:27 +00:00

Fix transfer group or repo bug (#6934)

* 01 fix transfer repo to other user

* 02 fix transfer group to other users

* 03 group no repo style
This commit is contained in:
Michael An
2024-10-23 07:43:02 +08:00
committed by GitHub
parent eb64781c68
commit bbeb36af8a
3 changed files with 13 additions and 5 deletions

View File

@@ -5,6 +5,7 @@ import { gettext } from '../../utils/constants';
import { seafileAPI } from '../../utils/seafile-api';
import UserSelect from '../user-select';
import { Utils } from '../../utils/utils';
import toaster from '../toast';
import '../../css/transfer-group-dialog.css';
@@ -34,10 +35,15 @@ class TransferGroupDialog extends React.Component {
};
transferGroup = () => {
const email = this.state.selectedOption && this.state.selectedOption.email;
let selectedOption = this.state.selectedOption;
let email;
if (selectedOption && selectedOption[0]) {
email = selectedOption[0].email;
}
if (email) {
seafileAPI.transferGroup(this.props.groupID, email).then((res) => {
this.props.toggleTransferGroupDialog();
toaster.success(gettext('Group has been transfered'));
}).catch((error) => {
let errMessage = Utils.getErrorMsg(error);
this.setState({ errMessage: errMessage });