1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 23:29:49 +00:00

change get group-list api

This commit is contained in:
shanshuirenjia
2018-12-10 13:30:44 +08:00
parent f6cff08bc6
commit 3240802532
2 changed files with 7 additions and 10 deletions

View File

@@ -26,13 +26,11 @@ class RepoListViewPanel extends React.Component {
componentDidMount() {
let group = this.props.group;
seafileAPI.listGroupRepos(group.id).then(res => {
let repoList = res.data.map(item => {
let repo = new RepoInfo(item);
return repo;
});
this.setState({repoList: repoList});
let repoList = group.repos.map(item => {
let repo = new RepoInfo(item);
return repo;
});
this.setState({repoList: repoList});
}
render() {
@@ -71,10 +69,10 @@ class GroupsView extends React.Component {
}
componentDidMount() {
seafileAPI.listGroups().then((res) => { // TODO: api name
seafileAPI.listGroupsV2({'with_repos': 1}).then((res) => { // TODO: api name
// `{'with_repos': 1}`: list repos of every group
// res: {data: [...], status: 200, statusText: "OK", headers: {…}, config: {…}, …}
let groupList = res.data.groups.map(item => {
let groupList = res.data.map(item => {
let group = new Group(item);
return group;
})
@@ -96,7 +94,6 @@ class GroupsView extends React.Component {
errorMsg: gettext("Error")
});
}
} else {
this.setState({
isLoading: false,