Ejemplo n.º 1
0
def update_or_delete_comment(defendant=None, comment=None):
    """ Update or delete defendant comments
    """
    if request.method == 'PUT':
        body = request.get_json()
        code, resp = CommentsController.update(body, comment_id=comment, user_id=g.user.id)
    else:
        code, resp = CommentsController.delete(comment_id=comment, defendant_id=defendant, user_id=g.user.id)

    return code, resp
Ejemplo n.º 2
0
def add_comment(defendant=None):
    """ Add comment to defendant
    """
    body = request.get_json()
    code, resp = CommentsController.create(body, defendant_id=defendant, user_id=g.user.id)
    return code, resp
Ejemplo n.º 3
0
def add_comment(ticket=None):
    """ Add comment to ticket
    """
    body = request.get_json()
    code, resp = CommentsController.create(body, ticket_id=ticket, user_id=g.user.id)
    return code, resp