1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-04 08:28:11 +00:00

Update dir api (#2869)

* update dir api

return dict format response

* [listDir] modified listDir after api updated
This commit is contained in:
lian
2019-01-22 18:27:51 +08:00
committed by Daniel Pan
parent 35c1663dc2
commit 0fb958d9bd
8 changed files with 89 additions and 85 deletions

View File

@@ -248,7 +248,7 @@ class Wiki extends Component {
loadSidePanel = (initialPath) => {
seafileAPI.listDir(repoID, '/',{recursive: true}).then(items => {
const files = items.data.map(item => {
const files = items.data.dirent_list.map(item => {
return {
name: item.name,
type: item.type === 'dir' ? 'dir' : 'file',
@@ -337,7 +337,7 @@ class Wiki extends Component {
this.setState({isDirentListLoading: true});
seafileAPI.listDir(repoID, path, {'with_thumbnail': true}).then(res => {
let direntList = [];
res.data.forEach(item => {
res.data.dirent_list.forEach(item => {
let fileName = item.name.toLowerCase();
if (fileName === 'readme.md' || fileName === 'readme.markdown') {
this.setState({readmeMarkdown: item});