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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user