new update profile
This commit is contained in:
+84
-1
@@ -301,7 +301,7 @@ INSERT INTO products_colorstyle (product_id, name, color_style, color_code ) VAL
|
|||||||
INSERT INTO products_colorstyle (product_id, name, color_style, color_code ) VALUES ('A000002','Red','red-theme.css','FF0000');
|
INSERT INTO products_colorstyle (product_id, name, color_style, color_code ) VALUES ('A000002','Red','red-theme.css','FF0000');
|
||||||
INSERT INTO products_colorstyle (product_id, name, color_style, color_code ) VALUES ('A000002','Violet','violet-theme.css','8F00FF');
|
INSERT INTO products_colorstyle (product_id, name, color_style, color_code ) VALUES ('A000002','Violet','violet-theme.css','8F00FF');
|
||||||
|
|
||||||
|
ALTER TABLE members_products ADD colorstyle VARCHAR(55);
|
||||||
|
|
||||||
{`nav-link ${(activeTab == value.controls || (index == 0 & !activeTab)) && 'active show'}`}
|
{`nav-link ${(activeTab == value.controls || (index == 0 & !activeTab)) && 'active show'}`}
|
||||||
|
|
||||||
@@ -376,6 +376,89 @@ VALUES(
|
|||||||
''
|
''
|
||||||
);
|
);
|
||||||
|
|
||||||
|
ALTER TABLE products_templates ADD flavor VARCHAR(10);
|
||||||
|
|
||||||
|
UPDATE products_templates SET provision_name='registry.chiefsoft.com/a000002/business-web-web0002d:latest', flavor='P1' WHERE ID =4;
|
||||||
|
UPDATE products_templates SET provision_name='registry.chiefsoft.com/a000002/business-web-web0002d:latest', flavor='P2' WHERE ID =5;
|
||||||
|
UPDATE products_templates SET provision_name='registry.chiefsoft.com/a000001/personal-web-web0002a:latest', flavor='P1' WHERE ID =1;
|
||||||
|
UPDATE products_templates SET provision_name='registry.chiefsoft.com/a000001/personal-web-web0002a:latest', flavor='P2' WHERE ID =2;
|
||||||
|
UPDATE products_templates SET provision_name='registry.chiefsoft.com/a000001/personal-web-web0002a:latest', flavor='P3' WHERE ID =3;
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO products_templates(product_id,name,provision_name,status,flavor)
|
||||||
|
VALUES(
|
||||||
|
'A000002',
|
||||||
|
'Practice 3',
|
||||||
|
'registry.chiefsoft.com/a000002/business-web-web0002d:latest',
|
||||||
|
1,
|
||||||
|
'P3'
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO products_templates(product_id,name,provision_name,status,flavor)
|
||||||
|
VALUES(
|
||||||
|
'A000002',
|
||||||
|
'Practice 4',
|
||||||
|
'registry.chiefsoft.com/a000002/business-web-web0002d:latest',
|
||||||
|
1,
|
||||||
|
'P4'
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO products_templates(product_id,name,provision_name,status,flavor)
|
||||||
|
VALUES(
|
||||||
|
'A000002',
|
||||||
|
'Practice 5',
|
||||||
|
'registry.chiefsoft.com/a000002/business-web-web0002d:latest',
|
||||||
|
1,
|
||||||
|
'P5'
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO products_templates(product_id,name,provision_name,status,flavor)
|
||||||
|
VALUES(
|
||||||
|
'A000002',
|
||||||
|
'Practice 6',
|
||||||
|
'registry.chiefsoft.com/a000002/business-web-web0002d:latest',
|
||||||
|
1,
|
||||||
|
'P6'
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO products_templates(product_id,name,provision_name,status,flavor)
|
||||||
|
VALUES(
|
||||||
|
'A000002',
|
||||||
|
'Practice 7',
|
||||||
|
'registry.chiefsoft.com/a000002/business-web-web0002d:latest',
|
||||||
|
1,
|
||||||
|
'P7'
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO products_templates(product_id,name,provision_name,status,flavor)
|
||||||
|
VALUES(
|
||||||
|
'A000002',
|
||||||
|
'Practice 8',
|
||||||
|
'registry.chiefsoft.com/a000002/business-web-web0002d:latest',
|
||||||
|
1,
|
||||||
|
'P8'
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO products_templates(product_id,name,provision_name,status,flavor)
|
||||||
|
VALUES(
|
||||||
|
'A000002',
|
||||||
|
'Practice 9',
|
||||||
|
'registry.chiefsoft.com/a000002/business-web-web0002d:latest',
|
||||||
|
1,
|
||||||
|
'P9'
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO products_templates(product_id,name,provision_name,status,flavor)
|
||||||
|
VALUES(
|
||||||
|
'A000002',
|
||||||
|
'Practice 10',
|
||||||
|
'registry.chiefsoft.com/a000002/business-web-web0002d:latest',
|
||||||
|
1,
|
||||||
|
'P10'
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE members_products (
|
CREATE TABLE members_products (
|
||||||
id SERIAL,
|
id SERIAL,
|
||||||
|
|||||||
@@ -123,6 +123,13 @@ def merms_account_profile():
|
|||||||
response = AccountService.process_profile_data(data)
|
response = AccountService.process_profile_data(data)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
@api.route("/panel/account/profile-update", methods=["POST"])
|
||||||
|
@jwt_required()
|
||||||
|
def merms_account_profile_update():
|
||||||
|
data = request.get_json()
|
||||||
|
response = AccountService.update_profile_data(data)
|
||||||
|
return response
|
||||||
|
|
||||||
|
|
||||||
@api.route("/panel/account-bar", methods=["POST"])
|
@api.route("/panel/account-bar", methods=["POST"])
|
||||||
@jwt_required()
|
@jwt_required()
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
from marshmallow import Schema, fields
|
||||||
|
|
||||||
|
class UserUpdateSchema(Schema):
|
||||||
|
token = fields.Str(required=True)
|
||||||
|
uid = fields.Str(required=True)
|
||||||
|
country = fields.Str(required=True)
|
||||||
|
firstname = fields.Str(required=True)
|
||||||
|
lastname = fields.Str(required=True)
|
||||||
|
full_address = fields.Str(required=True)
|
||||||
|
phone = fields.Str(required=True)
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
from flask import session, jsonify
|
from flask import session, jsonify
|
||||||
|
|
||||||
|
from app.api.schemas.user_update import UserUpdateSchema
|
||||||
# from app.models.loan import Loan
|
# from app.models.loan import Loan
|
||||||
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
|
||||||
@@ -476,6 +478,59 @@ class AccountService(BaseService):
|
|||||||
db.session.rollback()
|
db.session.rollback()
|
||||||
return ResponseHelper.internal_server_error()
|
return ResponseHelper.internal_server_error()
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def update_profile_data(data):
|
||||||
|
|
||||||
|
try:
|
||||||
|
with db.session.begin():
|
||||||
|
|
||||||
|
validated_data = AccountService.validate_data(data, UserUpdateSchema())
|
||||||
|
user_token = validated_data.get('token')
|
||||||
|
uid = str(validated_data.get('uid'))
|
||||||
|
member_data = Members.get_member_by_uid(uid)
|
||||||
|
|
||||||
|
personal_data = {
|
||||||
|
"firstname": member_data.firstname,
|
||||||
|
"lastname": member_data.lastname,
|
||||||
|
"account_name": member_data.account_name,
|
||||||
|
"phone": "911 111 1111",
|
||||||
|
"full_address": "100 White House, Washington, DC 00000",
|
||||||
|
"country": member_data.country,
|
||||||
|
}
|
||||||
|
|
||||||
|
external_links = {
|
||||||
|
"facebook_url": "facebook.com",
|
||||||
|
"twitter_url": "twitter.com",
|
||||||
|
"blogger_url": "blogger.com",
|
||||||
|
"google_url": "google.com",
|
||||||
|
"linked_url": "linkedin.com",
|
||||||
|
"website_url": "www.mysite.com",
|
||||||
|
}
|
||||||
|
|
||||||
|
profile_data = {
|
||||||
|
"personal_data": personal_data,
|
||||||
|
"external_links": external_links,
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResponseHelper.success(data=profile_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_test_email(data):
|
def process_test_email(data):
|
||||||
logger.info(f"Email Test Enter", exc_info=True)
|
logger.info(f"Email Test Enter", exc_info=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user