Skip to content

Commit

Permalink
Fixed Post Method
Browse files Browse the repository at this point in the history
  • Loading branch information
wreckage0907 committed Feb 19, 2024
1 parent 5c757e4 commit 282b8d2
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions apps/flask/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,19 @@ def add_details():
def get_data_from_firestore():
doc_ref = db.collection('needs_and_gives')
docs = doc_ref.stream()
data_list = []
need_list = []
give_list = []

for doc in docs:
data_list.append(doc.to_dict())
data = doc.to_dict()
if 'need' in data:
need_list.extend(data['need'])
if 'give' in data:
give_list.extend(data['give'])

# Accessing dictionaries by index
result = {"need":data_list[1]["need"],"give":data_list[0]["give"]}
return result,200
result = {"need": need_list, "give": give_list}
return result, 200




Expand Down

0 comments on commit 282b8d2

Please sign in to comment.