Example #1
0
def get_category_products(cat_id):
	resp = helpers.get_response(request)
	categories = Models().getBy('categories', 'id', cat_id)
	return jsonify({'category' : categories[0].id, 'products' : helpers.list_to_json(categories[0].products)}), 200
Example #2
0
def get_user_addresses(user_id):
	resp = helpers.get_response(request)
	user = Models().getBy('users', 'id', user_id)
	return jsonify({'user' : user[0].id, 'addresses' : helpers.list_to_json(user[0].bids)}), 200
Example #3
0
def get_user_payments(user_id):
	resp = helpers.get_response(request)
	user = Models().getBy('users', 'id', user_id)
	return jsonify({'user' : user[0].id, 'payments' : helpers.list_to_json(user[0].payments)}), 200
Example #4
0
def get_product_bids(product_id):
    resp = helpers.get_response(request)
    product = Models().getBy("products", "id", product_id)
    return jsonify({"product": product[0].id, "bids": helpers.list_to_json(product[0].bids)}), 200