site settings
This commit is contained in:
@@ -172,7 +172,7 @@ def myproduct_dash():
|
|||||||
@api.route("/panel/myproduct/settings", methods=["POST"])
|
@api.route("/panel/myproduct/settings", methods=["POST"])
|
||||||
def myproduct_settings():
|
def myproduct_settings():
|
||||||
data = request.get_json()
|
data = request.get_json()
|
||||||
logger.info(f"Route MyProduct Data ==>>>> {data}")
|
logger.info(f"Route MyProduct Settings Data ==>>>> {data}")
|
||||||
response = MyProductsService.process_settings(data)
|
response = MyProductsService.process_settings(data)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ class LoginService(BaseService):
|
|||||||
"error_message": "",
|
"error_message": "",
|
||||||
"pending_uid": user_data["pending_uid"],
|
"pending_uid": user_data["pending_uid"],
|
||||||
"pending_id": user_data["pending_id"],
|
"pending_id": user_data["pending_id"],
|
||||||
"reset_message": "Check your email to continue password reset.",
|
"reset_message": "Continue you password reset.",
|
||||||
"message_key": "continue_reset",
|
"message_key": "continue_reset",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -152,9 +152,59 @@ class MyProductsService(BaseService):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def process_settings(data):
|
def process_settings(data):
|
||||||
pass
|
try:
|
||||||
|
with db.session.begin():
|
||||||
|
logger.info(f"Incoming MyProduct Settings Data ==>>>> {data}")
|
||||||
|
validated_data = MyProductsService.validate_data(data, MyProductSchema())
|
||||||
|
token = validated_data.get('token')
|
||||||
|
uid = validated_data.get('uid')
|
||||||
|
|
||||||
|
member_data = Members.get_member_by_uid(uid)
|
||||||
|
member_id = member_data.id
|
||||||
|
product_id = validated_data.get('product_id')
|
||||||
|
product_settings = validated_data.get('settings')
|
||||||
|
|
||||||
|
|
||||||
|
memberSubscription = MembersProducts.get_member_product_by_product_member_id(member_id, product_id)
|
||||||
|
if memberSubscription is not None:
|
||||||
|
logger.info(f"Incoming MyProduct data ==>>>> {memberSubscription}")
|
||||||
|
productDataStatus = memberSubscription.status
|
||||||
|
product_subscription_uid = memberSubscription.uid
|
||||||
|
product_subscription_external_url = memberSubscription.external_url
|
||||||
|
product_subscription_internal_url = memberSubscription.internal_url
|
||||||
|
|
||||||
|
# "banner": "banner.jpg",
|
||||||
|
result_data = {
|
||||||
|
"myproudct": {
|
||||||
|
"result": "Reveived under development ",
|
||||||
|
"message": "to be fixed"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Simulate processing
|
||||||
|
response_data = {
|
||||||
|
"result": result_data,
|
||||||
|
"member_id": member_id,
|
||||||
|
"uid": uid,
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResponseHelper.success(data=response_data)
|
||||||
|
|
||||||
|
except ValidationError as err:
|
||||||
|
|
||||||
|
logger.error(f"Validation Error: {getattr(err, 'messages', str(err))}")
|
||||||
|
db.session.rollback()
|
||||||
|
return ResponseHelper.unprocessable_entity(result_description="Validation exception")
|
||||||
|
|
||||||
|
except ValueError as err:
|
||||||
|
logger.error(f"{getattr(err, 'messages', str(err))}")
|
||||||
|
db.session.rollback()
|
||||||
|
return ResponseHelper.error(result_description=str(err))
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"An error occurred: {str(e)}", exc_info=True)
|
||||||
|
db.session.rollback()
|
||||||
|
return ResponseHelper.internal_server_error()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def process_request(data):
|
def process_request(data):
|
||||||
|
|||||||
Reference in New Issue
Block a user