Revert "Made it so the save_to_db also returns the ID of the document"

This reverts commit 4a0ae88fed.
This commit is contained in:
Tiago Ribeiro
2023-11-29 15:23:30 +00:00
parent 4a0ae88fed
commit 760fe27411
2 changed files with 11 additions and 15 deletions

View File

@@ -51,10 +51,10 @@ def upload_file_firebase_get_url(bucket_name, destination_blob_name, source_file
def save_to_db(collection: str, item):
db = firestore.client()
collection_ref = db.collection(collection)
document_ref = collection_ref.add(item)
(update_time, document_ref) = collection_ref.add(item)
if document_ref:
print(f"Document added with ID: {document_ref}")
return (True, document_ref)
print(f"Document added with ID: {document_ref.id}")
return (True, document_ref.id)
else:
return (False, None)