awacke1 commited on
Commit
75b7013
·
verified ·
1 Parent(s): 6c7eed9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -755,21 +755,23 @@ def main():
755
 
756
  # Get client directly from container's client property
757
  client = container._client
 
 
758
 
759
  # Set up delete options
760
  options = {
761
  'enableCrossPartitionQuery': True,
762
- 'partitionKey': current_doc['id']
763
  }
764
 
765
  # Construct document link
766
- doc_link = f"dbs/{DATABASE_NAME}/colls/{CONTAINER_NAME}/docs/{current_doc['id']}"
767
 
768
  # Delete using client directly
769
  response = client.DeleteItem(doc_link, options)
770
 
771
  if response:
772
- st.success(f"Document {current_doc['id']} deleted successfully.")
773
  if st.session_state.current_index > 0:
774
  st.session_state.current_index -= 1
775
  st.rerun()
 
755
 
756
  # Get client directly from container's client property
757
  client = container._client
758
+ partitionKey = current_doc['id']
759
+ client = st.session_state.client
760
 
761
  # Set up delete options
762
  options = {
763
  'enableCrossPartitionQuery': True,
764
+ 'partitionKey': partitionKey
765
  }
766
 
767
  # Construct document link
768
+ doc_link = f"dbs/{DATABASE_NAME}/colls/{CONTAINER_NAME}/docs/{partitionKey}"
769
 
770
  # Delete using client directly
771
  response = client.DeleteItem(doc_link, options)
772
 
773
  if response:
774
+ st.success(f"Document {partitionKey} deleted successfully.")
775
  if st.session_state.current_index > 0:
776
  st.session_state.current_index -= 1
777
  st.rerun()