Ramesh-vani commited on
Commit
a0baead
·
verified ·
1 Parent(s): fef3566

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -72,7 +72,7 @@ async def rename_item(websocket, key,project_name, path,rpath,new_name,root, con
72
  except Exception as e:
73
  websockets.broadcast(connected,str(e))
74
 
75
- async def delete_item(websocket, key,project_name, path,rpath, connected):
76
  try:
77
 
78
  item_path = os.path.join(os.getcwd(), 'projects', key,project_name, rpath)
@@ -86,7 +86,8 @@ async def delete_item(websocket, key,project_name, path,rpath, connected):
86
  event = {
87
  "type": "delete-success",
88
  "data": path,
89
- "path":path
 
90
  }
91
  websockets.broadcast(connected,json.dumps(event))
92
  # websockets.broadcast(connected,'success')
@@ -349,7 +350,7 @@ async def exe(websocket,connected,key):
349
 
350
  elif event["command"]["type"]=="delete":
351
 
352
- await delete_item(websocket, key,event["project_name"], event["path"],event['rpath'], connected)
353
  elif event["command"]["type"]=="get_content":
354
 
355
  await get_file_content(websocket, key,event["project_name"],event["filePath"], event["rfilePath"],event["fileName"] ,connected)
 
72
  except Exception as e:
73
  websockets.broadcast(connected,str(e))
74
 
75
+ async def delete_item(websocket, key,project_name, path,rpath,targetElementData, connected):
76
  try:
77
 
78
  item_path = os.path.join(os.getcwd(), 'projects', key,project_name, rpath)
 
86
  event = {
87
  "type": "delete-success",
88
  "data": path,
89
+ "path":path,
90
+ "targetElementData":targetElementData,
91
  }
92
  websockets.broadcast(connected,json.dumps(event))
93
  # websockets.broadcast(connected,'success')
 
350
 
351
  elif event["command"]["type"]=="delete":
352
 
353
+ await delete_item(websocket, key,event["project_name"], event["path"],event['rpath'],event['targetElementData'], connected)
354
  elif event["command"]["type"]=="get_content":
355
 
356
  await get_file_content(websocket, key,event["project_name"],event["filePath"], event["rfilePath"],event["fileName"] ,connected)