<script type="text/javascript">
	
	function cancelFriendRequest(id, uiUpdateFunction){
		payload = {
			"csrfmiddlewaretoken": "{{ csrf_token }}",
			"receiver_user_id": id,
		}
		$.ajax({
			type: 'POST',
			dataType: "json",
			url: "{% url 'friend:friend-request-cancel' %}",
			data: payload,
			timeout: 5000,
			success: function(data) {
				console.log("SUCCESS", data)
				if(data['response'] == "Friend request canceled."){
					// ui is updated
				}
				else if(data['response'] != null){
					alert(d