dummy data
This commit is contained in:
@@ -2,13 +2,22 @@ from flask import jsonify
|
|||||||
from app.utils.logger import logger
|
from app.utils.logger import logger
|
||||||
from app.api.services.base_service import BaseService
|
from app.api.services.base_service import BaseService
|
||||||
from sqlalchemy import func, desc
|
from sqlalchemy import func, desc
|
||||||
|
from app.api.helpers.response_helper import ResponseHelper
|
||||||
|
from app.api.schemas.user import UserSchema
|
||||||
|
from app.models import Members
|
||||||
|
|
||||||
class SubscriptionService(BaseService):
|
class SubscriptionService(BaseService):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def subscription_available_products(data):
|
def subscription_available_products(data):
|
||||||
try:
|
try:
|
||||||
|
with db.session.begin():
|
||||||
|
validated_data = SubscriptionService.validate_data(data, UserSchema())
|
||||||
|
token = validated_data.get('token')
|
||||||
|
uid = validated_data.get('uid')
|
||||||
|
member_data = Members.get_member_by_uid(uid)
|
||||||
|
member_id = member_data.id
|
||||||
|
|
||||||
subscription_products_data = {
|
subscription_products_data = {
|
||||||
"current_product": {
|
"current_product": {
|
||||||
"display_name": "Current Subscriptions",
|
"display_name": "Current Subscriptions",
|
||||||
@@ -35,8 +44,10 @@ class SubscriptionService(BaseService):
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return subscription_products_data
|
|
||||||
|
return ResponseHelper.success(data=subscription_products_data)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"An error occurred while getting dashboard data: {str(e)}", exc_info=True)
|
logger.error(f"An error occurred while getting dashboard data: {str(e)}", exc_info=True)
|
||||||
return jsonify({"message": "Internal Server Error"}), 500
|
return jsonify({"message": "Internal Server Error"}), 500
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user