1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-07-16 08:16:55 +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,
});
});
}

View File

@ -2047,14 +2047,10 @@ def get_dir_entrys_by_id(request, repo, path, dir_id, request_type=None):
else:
dentrys = dir_list + file_list
data = dict()
data["data"] = dentrys
data["oid"] = dir_id
data["dir_perm"] = seafile_api.check_permission_by_path(repo.id, path, username)
response = HttpResponse(json.dumps(data), status=200,
response = HttpResponse(json.dumps(dentrys), status=200,
content_type=json_content_type)
# response["oid"] = dir_id
# response["dir_perm"] = seafile_api.check_permission_by_path(repo.id, path, username)
response["oid"] = dir_id
response["dir_perm"] = seafile_api.check_permission_by_path(repo.id, path, username)
return response
def get_shared_link(request, repo_id, path):

View File

@ -74,7 +74,7 @@
cache: false,
success: function(data) {
if (data.id !== cid) {
alert('File updated! Refresh.') //TODO
// alert('File updated! Refresh.') //TODO
}
}
})