def update_item(): data = request.get_json() if data is None: return jsonify({"success": False}) new_listing = Listings(**data) success = new_listing.update() return jsonify({"success": success})
def sort_sale(): key = request.get_json().get("curr_price", "orig_price") if key is None: return jsonify({"success": False}) success = Listings.search_sales(key) return jsonify({"success": success})
def sort_company(): key = request.get_json().get("manufacturer") if key is None: return jsonify({"success": False}) success = Listings.search_maker(key) return jsonify({"success": success})
def sort_person(): key = request.get_json().get("phone") if key is None: return jsonify({"success": False}) success = Listings.search_lister(key) return jsonify({"success": success})
def delete_item(): key = request.get_json().get("inv_key") if key is None: return jsonify({"success": False}) success = Listings.delete(key) return jsonify({"success": success})
def show_list(): whole_list = Listings.select_all() # python to change data structure here return jsonify({"Shoes": whole_list})