Skip to content

Commit

Permalink
add button to resend invite
Browse files Browse the repository at this point in the history
  • Loading branch information
mgasner committed Nov 9, 2017
1 parent 33e204c commit 7fae1c3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
4 changes: 4 additions & 0 deletions www/js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ angular.module('treephone.controllers', [])
})

.controller('FriendDetailCtrl', function($scope, $stateParams, Friends) {
$scope.invite = function () {
Friends.invite($stateParams.friendId);
// TODO: pop up a modal
}
Friends.get($stateParams.friendId).then(
function (friend) {
console.log(friend);
Expand Down
17 changes: 16 additions & 1 deletion www/js/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,21 @@ angular.module('treephone.services', [])
function () { return {};}
);
return promise;
}
},

invite: function(friendId) {
var req = {
method: 'GET',
url: api_root + '/users/' + friendId + '/invite',
headers: Auth.getHeaders()
};
var promise = $http(req)
.then(
function () { return {};},
function () { return {};}
);
return promise;
},

}
});
3 changes: 3 additions & 0 deletions www/templates/friend-detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@
</ion-list>
<h4>{{friend.first_name}} has {{friend.outdegree}} direct contacts
and {{friend.network_size}} people in their network.</h4>
<form ng-submit="invite()">
<button ion-button round>Resend invite</button> <br />
</form>
</ion-content>
</ion-view>

0 comments on commit 7fae1c3

Please sign in to comment.