1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-08 10:22:46 +00:00

add repo-operation

This commit is contained in:
shanshuirenjia
2018-12-08 11:53:45 +08:00
parent 5934d62bde
commit 5419f98d95
3 changed files with 150 additions and 11 deletions

View File

@@ -101,11 +101,21 @@ class GroupView extends React.Component {
onCreateRepo = (repo) => {
let groupId = this.props.groupID;
seafileAPI.createGroupRepo(groupId, repo).then(() => {
//todo update group list
seafileAPI.createGroupRepo(groupId, repo).then(res => {
let repo = new RepoInfo(res.data);
let repoList = this.addRepoItem(repo);
this.setState({repoList: repoList});
}).catch(() => {
//todo
});
}
addRepoItem = (repo) => {
let newRepoList = this.state.repoList.map(item => {return item;});
newRepoList.push(repo);
return newRepoList;
}
getEmptyTip = () => {
let currentGroup = this.state.currentGroup;
let emptyTip = null;