bar data
This commit is contained in:
@@ -85,7 +85,7 @@ def merms_account():
|
||||
@jwt_required()
|
||||
def merms_account_bar():
|
||||
data = request.get_json()
|
||||
response = AccountService.process_request(data)
|
||||
response = AccountService.process_bar_request(data)
|
||||
return response
|
||||
|
||||
@api.route("/panel/Account/actions", methods=["POST"])
|
||||
|
||||
@@ -22,8 +22,25 @@ from app.config import Config
|
||||
class AccountService(BaseService):
|
||||
|
||||
@staticmethod
|
||||
def process_request(data):
|
||||
def process_bar_request(data):
|
||||
bar_data = {
|
||||
"last_update": datetime.datetime.utcnow(),
|
||||
"top_bar": [
|
||||
{"id": "1", "description": "Contacts", "last_update": "10-10-2010 11:00 AM",
|
||||
"value": random.randint(0, 10), "data_span": 'Last 2 months'},
|
||||
{"id": "2", "description": "Site Traffic", "last_update": "10-10-2010 11:30 AM",
|
||||
"value": random.randint(0, 10), "data_span": 'Past 12 hours'},
|
||||
{"id": "3", "description": "Appointments", "last_update": "10-12-2010 11:30 AM",
|
||||
"value": random.randint(0, 10), "data_span": 'Last 14 days'},
|
||||
{"id": "4", "description": "Purchases", "last_update": "10-12-2010 11:30 AM",
|
||||
"value": random.randint(0, 10), "data_span": 'Last 3 months'},
|
||||
]
|
||||
}
|
||||
return ResponseHelper.success(data=bar_data)
|
||||
|
||||
|
||||
@staticmethod
|
||||
def process_request(data):
|
||||
try:
|
||||
with db.session.begin():
|
||||
|
||||
@@ -47,8 +64,6 @@ class AccountService(BaseService):
|
||||
|
||||
return ResponseHelper.success(data=response_data)
|
||||
|
||||
return ResponseHelper.success(data=response_data)
|
||||
|
||||
except ValidationError as err:
|
||||
|
||||
logger.error(f"Validation Error: {getattr(err, 'messages', str(err))}")
|
||||
|
||||
Reference in New Issue
Block a user