Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -331,18 +331,20 @@ async def check_user_doc(user_id: str = Form(...)):
|
|
| 331 |
user = user_ref.get()
|
| 332 |
if user.exists:
|
| 333 |
return {"dbUserExists": True}
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
"
|
| 342 |
-
"
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
|
|
|
|
|
|
| 346 |
return {"dbUserExists": False}
|
| 347 |
|
| 348 |
|
|
|
|
| 331 |
user = user_ref.get()
|
| 332 |
if user.exists:
|
| 333 |
return {"dbUserExists": True}
|
| 334 |
+
transaction_ref = transactions_collection_ref.document(user_id)
|
| 335 |
+
transaction = transaction_ref.get()
|
| 336 |
+
if not transaction.exists:
|
| 337 |
+
transaction_ref.set({
|
| 338 |
+
"no_sms": 0,
|
| 339 |
+
"no_contacts": 0,
|
| 340 |
+
"no_receipts": 0,
|
| 341 |
+
"no_business_cards": 0,
|
| 342 |
+
"purchased_credit": {
|
| 343 |
+
"image_detection": 100,
|
| 344 |
+
"sync_data": 500,
|
| 345 |
+
},
|
| 346 |
+
"uid": user_id,
|
| 347 |
+
})
|
| 348 |
return {"dbUserExists": False}
|
| 349 |
|
| 350 |
|