Example #1
0
def make_json_error(ex):
    if isinstance(ex, werkzeug_exceptions.HTTPException):
        status_code = ex.code
        description = ex.description
    else:
        status_code = 500
        description = str(ex)
    return api_utils.render({'error': status_code,
                             'error_message': description},
                            status=status_code)
Example #2
0
def shopping_delete(shopping_id):
    _api.delete_lease(shopping_id)
    return api_utils.render()
Example #3
0
def shopping_update(shopping_id, data):
    return api_utils.render(_api.update_shopping(shopping_id, data))
Example #4
0
def shopping_get(shopping_id):
    return api_utils.render(_api.get_shopping(shopping_id))
Example #5
0
def shopping_create(data):
    return api_utils.render(_api.create_shopping(data))
Example #6
0
def shopping_list():
    return api_utils.render(_api.get_shopping_list())
Example #7
0
def shopping_delete(shopping_id):
    _api.delete_lease(shopping_id)
    return api_utils.render()
Example #8
0
def shopping_update(shopping_id, data):
    return api_utils.render(_api.update_shopping(shopping_id, data))
Example #9
0
def shopping_get(shopping_id):
    return api_utils.render(_api.get_shopping(shopping_id))
Example #10
0
def shopping_create(data):
    return api_utils.render(_api.create_shopping(data))
Example #11
0
def shopping_list():
    return api_utils.render(_api.get_shopping_list())