add path userid
This commit is contained in:
@@ -152,10 +152,11 @@ def save_file():
|
||||
@file_bp.route('/file-tree', methods=['GET'])
|
||||
def file_tree():
|
||||
path = session.get('path')
|
||||
user_id = session.get('user_id')
|
||||
if not path:
|
||||
return jsonify({"error": "Missing path parameter"}), 400
|
||||
root_workspace_path = current_app.config['ROOT_WORKSPACE_PATH']
|
||||
base_path = f'{root_workspace_path}/{path}'
|
||||
base_path = f'{root_workspace_path}/{user_id}/{path}'
|
||||
if not os.path.exists(base_path):
|
||||
return jsonify({"error": "Workspace not found"}), 404
|
||||
tree = get_file_tree(base_path)
|
||||
|
||||
Reference in New Issue
Block a user