1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-18 08:16:07 +00:00

Merge pull request #2653 from haiwen/change-list-group-api

change list group api
This commit is contained in:
Daniel Pan
2018-12-17 17:22:13 +08:00
committed by GitHub

View File

@@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Link } from '@reach/router';
import Group from '../models/group';
import { gettext, siteRoot, enableWiki } from '../utils/constants';
import { seafileAPI } from '../utils/seafile-api';
import { Badge } from 'reactstrap';
@@ -43,11 +44,15 @@ class MainSideNav extends React.Component {
loadGroups = () => {
let _this = this;
seafileAPI.listGroups().then(res =>{
let data = res.data.groups;
this.groupsHeight = (data.length + 1) * _this.listHeight;
seafileAPI.listGroupsV2().then(res =>{
let groupList = res.data.map(item => {
let group = new Group(item);
return group;
})
this.groupsHeight = (groupList.length + 1) * _this.listHeight;
_this.setState({
groupItems: data
groupItems: groupList
});
});
}