API_GET_DONE
Some checks failed
K8S Fission Deployment / Deployment fission functions (push) Failing after 13s
Some checks failed
K8S Fission Deployment / Deployment fission functions (push) Failing after 13s
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user