1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-19 01:44:13 +00:00

Fix create wiki with department owner name (#6400)

* 01 fix add wiki department id change to email

* 02 fix wiki with same name
This commit is contained in:
Michael An
2024-07-23 14:40:52 +08:00
committed by GitHub
parent cd5a9b824c
commit 0fd8c9275a
3 changed files with 17 additions and 16 deletions

View File

@@ -10,7 +10,7 @@ import { SeahubSelect } from '../common/select';
const propTypes = {
toggleCancel: PropTypes.func.isRequired,
addWiki: PropTypes.func.isRequired,
currentDeptID: PropTypes.string,
currentDeptEmail: PropTypes.string,
};
class AddWikiDialog extends React.Component {
@@ -36,12 +36,13 @@ class AddWikiDialog extends React.Component {
let obj = {};
obj.value = departments[i].name;
obj.id = departments[i].id;
obj.email = departments[i].email;
obj.label = departments[i].name;
options.push(obj);
}
this.setState({ options });
if (this.props.currentDeptID) {
const selectedOption = options.find(op => op.id == this.props.currentDeptID);
if (this.props.currentDeptEmail) {
const selectedOption = options.find(op => op.email == this.props.currentDeptEmail);
this.setState({ selectedOption });
}
}).catch(error => {