1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-17 15:53:28 +00:00

repair groupownedgroup create bug

This commit is contained in:
shanshuirenjia
2018-12-16 11:17:17 +08:00
parent d7564bcbba
commit 4cbc72819e
5 changed files with 56 additions and 8 deletions

View File

@@ -44,6 +44,18 @@ class RepoListViewPanel extends React.Component {
});
}
onItemDelete = (repo) => {
let group = this.props.group;
seafileAPI.deleteGroupOwnedLibrary(group.id, repo.repo_id).then(() => {
let repoList = this.state.repoList.filter(item => {
return item.repo_id !== repo.repo_id;
});
this.setState({repoList: repoList});
}).catch(() => {
// todo;
});
}
render() {
let group = this.props.group;
const emptyTip = <p className="group-item-empty-tip">{gettext('No libraries')}</p>;
@@ -60,6 +72,7 @@ class RepoListViewPanel extends React.Component {
currentGroup={this.props.group}
repoList={this.state.repoList}
onItemUnshare={this.onItemUnshare}
onItemDelete={this.onItemDelete}
/>
}
</div>