Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -872,9 +872,23 @@ def main():
|
|
872 |
height=300)
|
873 |
|
874 |
if st.button("➕ Create New Document"):
|
|
|
|
|
|
|
|
|
|
|
875 |
try:
|
876 |
-
|
877 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
878 |
success, message = insert_record(container, new_doc)
|
879 |
if success:
|
880 |
st.success(f"New document created with id: {new_doc['id']} 🎉")
|
|
|
872 |
height=300)
|
873 |
|
874 |
if st.button("➕ Create New Document"):
|
875 |
+
#try:
|
876 |
+
# new_doc = json.loads(new_doc_str)
|
877 |
+
# new_doc['id'] = new_id # Ensure ID matches input field
|
878 |
+
|
879 |
+
|
880 |
try:
|
881 |
+
new_item = {
|
882 |
+
"id": str(uuid.uuid4()),
|
883 |
+
"Document": str(uuid.uuid4()),
|
884 |
+
}
|
885 |
+
|
886 |
+
container.create_item(new_item)
|
887 |
+
print(f"value loaded with ${new_item} \n")
|
888 |
+
except Exception:
|
889 |
+
print(Exception)
|
890 |
+
|
891 |
+
|
892 |
success, message = insert_record(container, new_doc)
|
893 |
if success:
|
894 |
st.success(f"New document created with id: {new_doc['id']} 🎉")
|