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

    business.name = data['name']
    business.logo = data['logo']
    business.location = data['location']
    business.category = data['category']
    business.bio = data['bio']

    business.save()

    if business.name == data['name']:
        return jsonify({
            'success': 'successfully updated',
            'business': {
                'id': business.id,
                'name': business.name,
                'logo': business.logo,
                'location': business.location,
                'category': business.category,
                'bio': business.bio,
                'owner': business.owner.username,
                'created_at': business.created_at,
                'updated_at': business.updated_at
            }
        }), 201

    return jsonify({'warning': 'Business Not Updated'}), 400
Updates a business given a business ID
    confirms if current user is owner of business
    
Updates a business given a business ID
confirms if current user is owner of business
Updates a business given a business ID confirms if current user is owner of business
def update_business(current_user, businessId):
    data = request.get_json()
    business = get_in_module('business', businessId)
    business.name = data['name']
    business.logo = data['logo']
    business.location = data['location']
    business.category = data['category']
    business.bio = data['bio']
    business.save()
    if business.name == data['name']:
        return jsonify({
            'success': 'successfully updated',
            'business': {
                'id': business.id,
                'name': business.name,
                'logo': business.logo,
                'location': business.location,
                'category': business.category,
                'bio': business.bio,
                'owner': business.owner.username,
                'created_at': business.created_at,
                'updated_at': business.updated_at
            }
        }), 201
    return jsonify({'warning': 'Business Not Updated'}), 400
def update_business ( current_user , businessId ) : data = request . get_json ( ) business = get_in_module ( 'business' , businessId ) business . name = data [ 'name' ] business . logo = data [ 'logo' ] business . location = data [ 'location' ] business . category = data [ 'category' ] business . bio = data [ 'bio' ] business . save ( ) if business . name == data [ 'name' ] : return jsonify ( { 'success' : 'successfully updated' , 'business' : { 'id' : business . id , 'name' : business . name , 'logo' : business . logo , 'location' : business . location , 'category' : business . category , 'bio' : business . bio , 'owner' : business . owner . username , 'created_at' : business . created_at , 'updated_at' : business . updated_at } } ) , 201 return jsonify ( { 'warning' : 'Business Not Updated' } ) , 400
Updates a business given a business ID
confirms if current user is owner of business
Updates a business given a business ID confirms if current user is owner of business
"""Updates a business given a business ID
    confirms if current user is owner of business
    """
current_user
businessId