def update_order_details(): cn_db = db_oddt.order_details(con_db) data = request.json oddt1 = oddt.order_details(data['order_details_id'], data['order_id'], data['product_id'], data['unit_price'], data['quantity'], data['discount']) rs = cn_db.update(oddt1) return jsonify({'message': rs}), 200
def one_order_details(order_details_id): c = oddt.order_details(order_details_id=order_details_id) rs = db_oddt.order_details(con_db).get_by_id(c) if rs[1] != 200: return jsonify({'message': rs[0]}), rs[1] return jsonify({'message': rs[0].to_json()}), 200
def delete_order_details(order_details_id): cn_db = db_oddt.order_details(con_db) rs = cn_db.delete(order_details_id) return jsonify({'message': rs}), 200
def all_order_details(): result = db_oddt.order_details(con_db).get_all() return jsonify({'data': result}), 200