1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-31 14:42:10 +00:00

get dir_id from headers

This commit is contained in:
wangjianhui
2018-12-13 11:15:20 +08:00
parent d6aa80c72e
commit c0651fbf5f
4 changed files with 8 additions and 12 deletions

View File

@@ -74,13 +74,13 @@ class DirView extends React.Component {
let repoID = this.state.repoID;
this.setState({isDirentListLoading: true});
seafileAPI.listDir(repoID, filePath).then(res => {
let direntList = res.data.data.map(item => {
let direntList = res.data.map(item => {
return new Dirent(item);
});
this.setState({
isDirentListLoading: false,
direntList: direntList,
dirID: res.data.oid,
dirID: res.headers.oid,
});
}).catch(() => {
this.setState({pathExist: false});

View File

@@ -272,14 +272,14 @@ class Wiki extends Component {
this.setState({isDirentListLoading: true});
seafileAPI.listDir(repoID, filePath).then(res => {
let direntList = [];
res.data.data.forEach(item => {
res.data.forEach(item => {
let dirent = new Dirent(item);
direntList.push(dirent);
});
this.setState({
direntList: direntList,
isDirentListLoading: false,
dirID: res.data.oid,
dirID: res.headers.oid,
});
});
}