Update app.py
Browse files
app.py
CHANGED
|
@@ -1828,7 +1828,7 @@ def from_shop_st():
|
|
| 1828 |
api_sys_control = request.args.get('api_sys')
|
| 1829 |
|
| 1830 |
if api_sys_control != api_key_sys:
|
| 1831 |
-
return
|
| 1832 |
|
| 1833 |
name = request.args.get('name', '')
|
| 1834 |
email = request.args.get('email', '')
|
|
@@ -1838,7 +1838,7 @@ def from_shop_st():
|
|
| 1838 |
del_flag = request.args.get('del', '')
|
| 1839 |
|
| 1840 |
if not email or not phone:
|
| 1841 |
-
return
|
| 1842 |
|
| 1843 |
# Очистка номера телефона
|
| 1844 |
phone = clean_phone_number_ss(phone)
|
|
@@ -1870,10 +1870,10 @@ def from_shop_st():
|
|
| 1870 |
conn.commit()
|
| 1871 |
conn.close()
|
| 1872 |
|
| 1873 |
-
return
|
| 1874 |
|
| 1875 |
except Exception as e:
|
| 1876 |
-
return
|
| 1877 |
|
| 1878 |
|
| 1879 |
|
|
|
|
| 1828 |
api_sys_control = request.args.get('api_sys')
|
| 1829 |
|
| 1830 |
if api_sys_control != api_key_sys:
|
| 1831 |
+
return json.dumps({"error": "Unauthorized access"}), 403
|
| 1832 |
|
| 1833 |
name = request.args.get('name', '')
|
| 1834 |
email = request.args.get('email', '')
|
|
|
|
| 1838 |
del_flag = request.args.get('del', '')
|
| 1839 |
|
| 1840 |
if not email or not phone:
|
| 1841 |
+
return json.dumps({"error": "Email and phone are required"}), 400
|
| 1842 |
|
| 1843 |
# Очистка номера телефона
|
| 1844 |
phone = clean_phone_number_ss(phone)
|
|
|
|
| 1870 |
conn.commit()
|
| 1871 |
conn.close()
|
| 1872 |
|
| 1873 |
+
return json.dumps(shop_st_data), 200
|
| 1874 |
|
| 1875 |
except Exception as e:
|
| 1876 |
+
return json.dumps({"error": str(e)}), 500
|
| 1877 |
|
| 1878 |
|
| 1879 |
|