update routes
This commit is contained in:
@@ -527,6 +527,15 @@ def get_product_view_office():
|
|||||||
result = OfficeDashboardService.get_office_product_detail(filters)
|
result = OfficeDashboardService.get_office_product_detail(filters)
|
||||||
return jsonify(result)
|
return jsonify(result)
|
||||||
|
|
||||||
|
@api.route('/office/product-update', methods=['POST'])
|
||||||
|
def get_product_update_office():
|
||||||
|
# Call the dashboard service
|
||||||
|
data = request.get_json()
|
||||||
|
|
||||||
|
result = OfficeDashboardService.get_office_product_update(data)
|
||||||
|
return jsonify(result)
|
||||||
|
|
||||||
|
|
||||||
@api.route('/office/products-templates', methods=['GET'])
|
@api.route('/office/products-templates', methods=['GET'])
|
||||||
def get_product_templates():
|
def get_product_templates():
|
||||||
# Call the dashboard service
|
# Call the dashboard service
|
||||||
|
|||||||
@@ -189,6 +189,42 @@ class OfficeDashboardService(BaseService):
|
|||||||
|
|
||||||
return products_result
|
return products_result
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_office_product_update(filters):
|
||||||
|
product_id = filters.get('product_id')
|
||||||
|
product_data=[]
|
||||||
|
products = Products.get_product_by_product_id(product_id)
|
||||||
|
if products:
|
||||||
|
product_data = {
|
||||||
|
'id': products.id,
|
||||||
|
'uid': products.uid,
|
||||||
|
'product_id': products.product_id,
|
||||||
|
'description': products.description,
|
||||||
|
'name': products.name,
|
||||||
|
'status': products.status,
|
||||||
|
'added': products.added.isoformat() if products.added else None,
|
||||||
|
'updated': products.updated.isoformat() if products.updated else None,
|
||||||
|
'banner': products.banner,
|
||||||
|
}
|
||||||
|
|
||||||
|
product_details= []
|
||||||
|
productDetails =ProductsDetails.get_product_details_with_product_id(product_id)
|
||||||
|
if productDetails:
|
||||||
|
product_details = {
|
||||||
|
'product_detail_id': productDetails.id,
|
||||||
|
'product_id': productDetails.product_id,
|
||||||
|
'details': productDetails.details,
|
||||||
|
'sale_text': productDetails.sale_text,
|
||||||
|
'added': productDetails.added.isoformat() if productDetails.added else None,
|
||||||
|
}
|
||||||
|
|
||||||
|
products_result = {
|
||||||
|
"update_result": [],
|
||||||
|
}
|
||||||
|
|
||||||
|
return products_result
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_office_product_templates(filters):
|
def get_office_product_templates(filters):
|
||||||
templates = ProductsTemplates.get_template_for_office(filters)
|
templates = ProductsTemplates.get_template_for_office(filters)
|
||||||
|
|||||||
Reference in New Issue
Block a user