def get_cart(): utilities.is_authenticated() cart = session['cart'] resp = 200 if len(cart) == 0: resp = 204 return jsonify({'cart': cart}), resp
def get_pms(): utilities.is_authenticated() pms = ubid_mng.get_pms() resp = 200 if len(pms) == 0: resp = 204 return jsonify({'private_messages': pms}), resp
def add_product(): utilities.is_authenticated() product = ubid_mng.add_product(request.json) return jsonify({'product': product}), 201
def add_category(): utilities.is_authenticated() category = ubid_mng.add_category(request.json) return jsonify({'category': category}), 201
def add_to_cart(product_id): utilities.is_authenticated() cart = ubid_mng.add_to_cart(product_id) return jsonify({'cart': cart}), 200
def bid(product_id): utilities.is_authenticated() product = ubid_mng.bid_on_product(product_id, request.json) return jsonify({'product': product}), 200
def rate_user(user_id): utilities.is_authenticated() user = ubid_mng.rate_user(user_id, request.json) return jsonify({'user': user}), 200
def add_pm(): utilities.is_authenticated() pm = ubid_mng.add_pm(request.json) return jsonify({'private_message': pm}), 201
def read_pm(pm_id): utilities.is_authenticated() pm = ubid_mng.read_pm(pm_id) return jsonify({'private_message': pm}), 200
def update_product(product_id): utilities.is_authenticated() product = ubid_mng.update_product(product_id, request.json) return jsonify({'product_updated': product.jsonify()}), 200