rairo commited on
Commit
3ab40bd
·
verified ·
1 Parent(s): ae0e425

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +5 -2
main.py CHANGED
@@ -281,6 +281,9 @@ def get_spending_overview():
281
  .to_dict(orient='records')
282
  })
283
  except Exception as e:
 
 
 
284
  return jsonify({'error': str(e) + f'transactions:{transactions}'}), 500
285
 
286
  # ... (previous imports remain the same)
@@ -323,8 +326,8 @@ def get_admin_overview():
323
  users_list.append({
324
  'uid': uid,
325
  'email': email,
326
- 'daily_cash': user_data.get('daily_cash', 100),
327
- 'remaining_cash': user_data.get('remaining_cash', 100),
328
  'last_reset': user_data.get('last_reset'),
329
  'is_admin': user_data.get('is_admin', False)
330
  })
 
281
  .to_dict(orient='records')
282
  })
283
  except Exception as e:
284
+ uid = verify_token(request.headers.get('Authorization', '').split(' ')[1])
285
+ transactions_ref = db.reference('transactions')
286
+ transactions = transactions_ref.order_by_child('uid').equal_to(uid).get()
287
  return jsonify({'error': str(e) + f'transactions:{transactions}'}), 500
288
 
289
  # ... (previous imports remain the same)
 
326
  users_list.append({
327
  'uid': uid,
328
  'email': email,
329
+ 'daily_cash': user_data.get('daily_cash', 0),
330
+ 'remaining_cash': user_data.get('remaining_cash', 0),
331
  'last_reset': user_data.get('last_reset'),
332
  'is_admin': user_data.get('is_admin', False)
333
  })