Product test

This commit is contained in:
CHIEFSOFT\ameye
2025-01-10 06:59:06 -05:00
parent 2864375006
commit bfbe9bed6d
+21 -3
View File
@@ -734,14 +734,32 @@ def myproduct(current_user):
def subscription_start(current_user):
data = request.json
product_id = data.get('product_id')
#request.args.get('product_id')
print(product_id)
if not product_id:
return {
"message": "Please provide product_id",
"data": None,
"error": "Bad request"
}, 400
}, 400
#request.args.get('product_id')
FIND_PRODUCT= "SELECT uid,product_id,name,description,banner,status FROM products WHERE product_id='"+product_id+"'"
with connection:
with connection.cursor(cursor_factory=psycopg2.extras.DictCursor) as cursor:
cursor.execute(FIND_PRODUCT)
product = cursor.fetchall()
print(product[0]["uid"])
product_found = count = len( product )
if product_found == 0 :
return jsonify({'status': "INVALID",'message': 'Error - Invalid product'}), 403
# if not product_id:
# return {
# "message": "Please provide product_id",
# "data": None,
# "error": "Bad request"
# }, 400
print(product_id)
myproduct_data = []