versions/v2/review.py
def update_business(current_user, businessId, reviewId):
    """Updates a review given a business ID
    confirms if current user is owner of business
    """
    data = request.get_json()
    review = Review.query.get(reviewId)

    review.title = data['title']
    review.desc = data['desc']

    review.save()

    if review.title == data['title']:
        return jsonify({
            'success': 'successfully updated',
            'review': {
                'id': review.id,
                'title': review.title,
                'desc': review.desc,
                'reviewer': review.reviewer.username,
                'business': review.business.name,
                'created_at': review.created_at,
                'updated_at': review.updated_at
            }
        }), 201

    return jsonify({'warning': 'Review Not Updated'}), 400
Updates a review given a business ID
    confirms if current user is owner of business
    
Updates a review given a business ID
confirms if current user is owner of business
Updates a review given a business ID confirms if current user is owner of business
def update_business(current_user, businessId, reviewId):
    data = request.get_json()
    review = Review.query.get(reviewId)
    review.title = data['title']
    review.desc = data['desc']
    review.save()
    if review.title == data['title']:
        return jsonify({
            'success': 'successfully updated',
            'review': {
                'id': review.id,
                'title': review.title,
                'desc': review.desc,
                'reviewer': review.reviewer.username,
                'business': review.business.name,
                'created_at': review.created_at,
                'updated_at': review.updated_at
            }
        }), 201
    return jsonify({'warning': 'Review Not Updated'}), 400
def update_business ( current_user , businessId , reviewId ) : data = request . get_json ( ) review = Review . query . get ( reviewId ) review . title = data [ 'title' ] review . desc = data [ 'desc' ] review . save ( ) if review . title == data [ 'title' ] : return jsonify ( { 'success' : 'successfully updated' , 'review' : { 'id' : review . id , 'title' : review . title , 'desc' : review . desc , 'reviewer' : review . reviewer . username , 'business' : review . business . name , 'created_at' : review . created_at , 'updated_at' : review . updated_at } } ) , 201 return jsonify ( { 'warning' : 'Review Not Updated' } ) , 400
Updates a review given a business ID
confirms if current user is owner of business
Updates a review given a business ID confirms if current user is owner of business
"""Updates a review given a business ID
    confirms if current user is owner of business
    """
current_user
businessId
reviewId