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

This commit is contained in:
Tiago Ribeiro
2023-11-29 14:55:40 +00:00
parent 869e74f384
commit 4a0ae88fed
2 changed files with 14 additions and 10 deletions

View File

@@ -54,9 +54,9 @@ def save_to_db(collection: str, item):
document_ref = collection_ref.add(item)
if document_ref:
print(f"Document added with ID: {document_ref}")
return True
return (True, document_ref)
else:
return False
return (False, None)