1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-04 00:20:07 +00:00

Fix load departments in not Pro (#7333)

* 01 fix only isPro load departments

* 02 fix transfer repo
This commit is contained in:
Michael An
2025-01-08 15:58:05 +08:00
committed by GitHub
parent 5a8c9149b9
commit d1e0347194
4 changed files with 37 additions and 34 deletions

View File

@@ -53,29 +53,31 @@ class TransferDialog extends React.Component {
};
componentDidMount() {
if (this.props.isOrgAdmin) {
orgAdminAPI.orgAdminListDepartments(orgID).then((res) => {
this.updateOptions(res);
}).catch(error => {
let errMessage = Utils.getErrorMsg(error);
toaster.danger(errMessage);
});
}
else if (this.props.isSysAdmin) {
systemAdminAPI.sysAdminListDepartments().then((res) => {
this.updateOptions(res);
}).catch(error => {
let errMessage = Utils.getErrorMsg(error);
toaster.danger(errMessage);
});
}
else if (isPro) {
seafileAPI.listDepartments().then((res) => {
this.updateOptions(res);
}).catch(error => {
let errMessage = Utils.getErrorMsg(error);
toaster.danger(errMessage);
});
if (isPro) {
if (this.props.isOrgAdmin) {
orgAdminAPI.orgAdminListDepartments(orgID).then((res) => {
this.updateOptions(res);
}).catch(error => {
let errMessage = Utils.getErrorMsg(error);
toaster.danger(errMessage);
});
}
else if (this.props.isSysAdmin) {
systemAdminAPI.sysAdminListDepartments().then((res) => {
this.updateOptions(res);
}).catch(error => {
let errMessage = Utils.getErrorMsg(error);
toaster.danger(errMessage);
});
}
else {
seafileAPI.listDepartments().then((res) => {
this.updateOptions(res);
}).catch(error => {
let errMessage = Utils.getErrorMsg(error);
toaster.danger(errMessage);
});
}
}
}

View File

@@ -230,11 +230,11 @@ class SharedRepoListItem extends React.Component {
this.setState({ isTransferDialogShow: !this.state.isTransferDialogShow });
};
onTransferRepo = (user, reshare) => {
onTransferRepo = (email, reshare) => {
let repoID = this.props.repo.repo_id;
let groupID = this.props.currentGroup.id;
userAPI.depAdminTransferRepo(repoID, groupID, user.email, reshare).then(res => {
this.props.onTransferRepo(repoID, groupID, user.email);
userAPI.depAdminTransferRepo(repoID, groupID, email, reshare).then(res => {
this.props.onTransferRepo(repoID, groupID, email);
let message = gettext('Successfully transferred the library.');
toaster.success(message);
}).catch(error => {