API_GET_DONE
Some checks failed
K8S Fission Deployment / Deployment fission functions (push) Failing after 13s

This commit is contained in:
QuangMinh_123
2025-12-10 10:36:46 +00:00
parent 24e4db954a
commit ec3b3303f6
2 changed files with 20 additions and 3 deletions

View File

@@ -48,7 +48,7 @@ def make_insert_request():
if crud.exists_phone(phone_number, user_id):
return jsonify({"error": "Phone is exists"}), 404
response, status = crud.create_phone(user_id, data)
response, status, headers = crud.create_phone(user_id, data)
return jsonify(response)
except Exception as e:
@@ -67,6 +67,17 @@ def make_get_request():
print(paging)
response = crud.filter_phone(user_id, paging)
# Kiểm tra xem response có dữ liệu hay không
if not response[0]: # Nếu không có dữ liệu
return jsonify({"message": "No phone numbers found"}), 404, CORS_HEADERS
return jsonify({
"data": response[0], # Dữ liệu (danh sách các số điện thoại)
"status": response[1], # Mã trạng thái HTTP (200)
"headers": response[2] # Headers CORS
}), response[1], response[2]
return jsonify(response), 200, CORS_HEADERS
except Exception as e:
return jsonify({"error": str(e)}), 500