@app.route('/products', methods=['GET'])
@cross_origin(supports_credentials=True)
def get_all_products():
    search = request.args.get('search', None)
    if (not search):
        products = Product.query.all()
    else:
        search = '%{}%'.format(search)
        products = Product.query.filter(Product.description.like(search)).all()
        if (not products):
            return (jsonify([]), 200)
    product_schema = ProductSchema(many=True)
    output = product_schema.dump(products)
    return (jsonify(output), 200)
@app.route('/products', methods=['GET'])
@cross_origin(supports_credentials=True)
def get_all_products():
    search = request.args.get('search', None)
    if (not search):
        products = Product.query.all()
    else:
        search = '%{}%'.format(search)
        products = Product.query.filter(Product.description.like(search)).all()
        if (not products):
            return (jsonify([]), 200)
    product_schema = ProductSchema(many=True)
    output = product_schema.dump(products)
    return (jsonify(output), 200)