def get_response_text(response):
    """
    Combines message and errors returned by a function to create an HTML to be displayed in a modal
    """
    messageHTML = ""
    if "message" in response:
        messageHTML += "<h4>" + response["message"] + "</h4>"
        
    if "error" in response:
        for key in response["error"]:
            for error in response["error"][key]:
                messageHTML += "<h4>" + error + "</h4>"
    
    return messageHTML