Updated claude big changes
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import logging
|
||||
from flask import jsonify
|
||||
from app.query import query
|
||||
from app import db
|
||||
from app.common.responses import success_response
|
||||
from app.classes.admin import Admin_Company
|
||||
from app.classes.query import (Query_StateList,
|
||||
Query_DeliveryStatusList,
|
||||
@@ -28,7 +28,7 @@ def get_company(company_id):
|
||||
.filter(Admin_Company.id == company_id)
|
||||
.first())
|
||||
delivery_schema = Query_DeliveryStatusList_Schema(many=False)
|
||||
return jsonify(delivery_schema.dump(query_data))
|
||||
return success_response({"company": delivery_schema.dump(query_data)})
|
||||
|
||||
@query.route("/states", methods=["GET"])
|
||||
@login_required
|
||||
@@ -43,7 +43,7 @@ def get_state_list():
|
||||
.all()
|
||||
|
||||
customer_schema = Query_StateList_Schema(many=True)
|
||||
return jsonify(customer_schema.dump(query_data))
|
||||
return success_response({"states": customer_schema.dump(query_data)})
|
||||
|
||||
|
||||
@query.route("/customertype", methods=["GET"])
|
||||
@@ -58,7 +58,7 @@ def get_customer_type_list():
|
||||
.query(Query_CustomerTypeList) \
|
||||
.all()
|
||||
customer_schema = Query_CustomerTypeList_Schema(many=True)
|
||||
return jsonify(customer_schema.dump(query_data))
|
||||
return success_response({"customer_types": customer_schema.dump(query_data)})
|
||||
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ def get_employee_type_list():
|
||||
.query(Query_EmployeeTypeList) \
|
||||
.all()
|
||||
customer_schema = Query_EmployeeTypeList_Schema(many=True)
|
||||
return jsonify(customer_schema.dump(query_data))
|
||||
return success_response({"employee_types": customer_schema.dump(query_data)})
|
||||
|
||||
|
||||
@query.route("/deliverystatus", methods=["GET"])
|
||||
@@ -90,4 +90,4 @@ def get_delivery_status_list():
|
||||
.query(Query_DeliveryStatusList) \
|
||||
.all()
|
||||
delivery_schema = Query_DeliveryStatusList_Schema(many=True)
|
||||
return jsonify(delivery_schema.dump(query_data))
|
||||
return success_response({"delivery_statuses": delivery_schema.dump(query_data)})
|
||||
|
||||
Reference in New Issue
Block a user