DmitrMakeev commited on
Commit
28bdcf3
·
verified ·
1 Parent(s): f9d7605

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -879,17 +879,17 @@ def update_or_insert_user(db_name, user_data, mapping_template):
879
  def send_request():
880
  token = request.form.get('token')
881
  minDate = request.form.get('minDate')
882
- limit = int(request.form.get('limit', 20)) # Значение по умолчанию = 20
 
883
  type = request.form.get('type', 'LiveWebinars')
884
 
885
- # Пример URL с учетом параметров запроса
886
- url = f'https://online.bizon365.ru/api/v1/webinars?limit={limit}&type={type}&minDate={minDate}'
887
 
888
  response = requests.get(url, headers={'X-Token': token})
889
 
890
  if response.status_code == 200:
891
  data = response.json()
892
- # Здесь обработка данных и возврат ответа
893
  return jsonify(data)
894
  else:
895
  return jsonify({'error': 'Failed to fetch data from the API'}), response.status_code
 
879
  def send_request():
880
  token = request.form.get('token')
881
  minDate = request.form.get('minDate')
882
+ maxDate = request.form.get('maxDate')
883
+ limit = request.form.get('limit', 20)
884
  type = request.form.get('type', 'LiveWebinars')
885
 
886
+ # Создание URL с параметрами
887
+ url = f'https://online.bizon365.ru/api/v1/webinars?type={type}&minDate={minDate}&maxDate={maxDate}&limit={limit}'
888
 
889
  response = requests.get(url, headers={'X-Token': token})
890
 
891
  if response.status_code == 200:
892
  data = response.json()
 
893
  return jsonify(data)
894
  else:
895
  return jsonify({'error': 'Failed to fetch data from the API'}), response.status_code