mirror of
https://github.com/haiwen/seahub.git
synced 2025-07-17 16:52:09 +00:00
get dir_id from headers
This commit is contained in:
parent
d6aa80c72e
commit
c0651fbf5f
@ -74,13 +74,13 @@ class DirView extends React.Component {
|
|||||||
let repoID = this.state.repoID;
|
let repoID = this.state.repoID;
|
||||||
this.setState({isDirentListLoading: true});
|
this.setState({isDirentListLoading: true});
|
||||||
seafileAPI.listDir(repoID, filePath).then(res => {
|
seafileAPI.listDir(repoID, filePath).then(res => {
|
||||||
let direntList = res.data.data.map(item => {
|
let direntList = res.data.map(item => {
|
||||||
return new Dirent(item);
|
return new Dirent(item);
|
||||||
});
|
});
|
||||||
this.setState({
|
this.setState({
|
||||||
isDirentListLoading: false,
|
isDirentListLoading: false,
|
||||||
direntList: direntList,
|
direntList: direntList,
|
||||||
dirID: res.data.oid,
|
dirID: res.headers.oid,
|
||||||
});
|
});
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.setState({pathExist: false});
|
this.setState({pathExist: false});
|
||||||
|
@ -272,14 +272,14 @@ class Wiki extends Component {
|
|||||||
this.setState({isDirentListLoading: true});
|
this.setState({isDirentListLoading: true});
|
||||||
seafileAPI.listDir(repoID, filePath).then(res => {
|
seafileAPI.listDir(repoID, filePath).then(res => {
|
||||||
let direntList = [];
|
let direntList = [];
|
||||||
res.data.data.forEach(item => {
|
res.data.forEach(item => {
|
||||||
let dirent = new Dirent(item);
|
let dirent = new Dirent(item);
|
||||||
direntList.push(dirent);
|
direntList.push(dirent);
|
||||||
});
|
});
|
||||||
this.setState({
|
this.setState({
|
||||||
direntList: direntList,
|
direntList: direntList,
|
||||||
isDirentListLoading: false,
|
isDirentListLoading: false,
|
||||||
dirID: res.data.oid,
|
dirID: res.headers.oid,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -2047,14 +2047,10 @@ def get_dir_entrys_by_id(request, repo, path, dir_id, request_type=None):
|
|||||||
else:
|
else:
|
||||||
dentrys = dir_list + file_list
|
dentrys = dir_list + file_list
|
||||||
|
|
||||||
data = dict()
|
response = HttpResponse(json.dumps(dentrys), status=200,
|
||||||
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,
|
|
||||||
content_type=json_content_type)
|
content_type=json_content_type)
|
||||||
# response["oid"] = dir_id
|
response["oid"] = dir_id
|
||||||
# response["dir_perm"] = seafile_api.check_permission_by_path(repo.id, path, username)
|
response["dir_perm"] = seafile_api.check_permission_by_path(repo.id, path, username)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def get_shared_link(request, repo_id, path):
|
def get_shared_link(request, repo_id, path):
|
||||||
|
@ -74,7 +74,7 @@
|
|||||||
cache: false,
|
cache: false,
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if (data.id !== cid) {
|
if (data.id !== cid) {
|
||||||
alert('File updated! Refresh.') //TODO
|
// alert('File updated! Refresh.') //TODO
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user