swag-shop/app/api/routes/product_routes.py

20 lines
473 B
Python
Raw Normal View History

2024-03-05 16:01:26 +01:00
from flask import jsonify, abort, request
from app.api import bp_product
from app.services.product_service import ProductService
@bp_product.route('/<int:id>', methods=['GET'])
2024-03-08 14:05:22 +01:00
def get_product_info(id: int):
fields = ['name', 'price', 'image', 'image_name', 'seller']
2024-03-05 16:01:26 +01:00
2024-03-08 14:05:22 +01:00
fields_param = request.args.get('fields')
requested_fields = []
return abort(501)
2024-03-05 16:01:26 +01:00
@bp_product.route('/create', methods=['POST'])
def create_product_listing():
name = request.json.get('name')