mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
Api v3 members port (#7109)
* Ported groups service to user new api v3 and ported dependent controllers * Remove and extra remove inviation code. Fixed group service caching and update group service tests * Fixed test logic and added party cache support * Updated members service to use api v3 * Removed onlys * Added invites to group detail * Removed old user reject invite code
This commit is contained in:
committed by
Matteo Pagliazzi
parent
570d5c7fd9
commit
415418f30c
@@ -20,16 +20,17 @@ habitrpg
|
||||
});
|
||||
|
||||
$scope.sendPrivateMessage = function(uuid, message){
|
||||
// Don't do anything if the user somehow gets here without a message.
|
||||
if (!message) return;
|
||||
|
||||
$http.post('/api/v2/members/'+uuid+'/message',{message:message}).success(function(){
|
||||
Notification.text(window.env.t('messageSentAlert'));
|
||||
$rootScope.User.sync();
|
||||
$scope.$close();
|
||||
});
|
||||
Members.sendPrivateMessage(message, uuid)
|
||||
.then(function (response) {
|
||||
Notification.text(window.env.t('messageSentAlert'));
|
||||
$rootScope.User.sync();
|
||||
$scope.$close();
|
||||
});
|
||||
};
|
||||
|
||||
//@TODO: We don't send subscriptions so the structure has changed in the back. Update this when we update the views.
|
||||
$scope.gift = {
|
||||
type: 'gems',
|
||||
gems: {amount:0, fromBalance:true},
|
||||
@@ -37,12 +38,13 @@ habitrpg
|
||||
message:''
|
||||
};
|
||||
|
||||
$scope.sendGift = function(uuid, gift){
|
||||
$http.post('/api/v2/members/'+uuid+'/gift', gift).success(function(){
|
||||
Notification.text('Gift sent!')
|
||||
$rootScope.User.sync();
|
||||
$scope.$close();
|
||||
})
|
||||
$scope.sendGift = function (uuid, gift) {
|
||||
Members.transferGems(message, uuid, $scope.gift.gems.amount)
|
||||
.then(function (response) {
|
||||
Notification.text('Gift sent!')
|
||||
$rootScope.User.sync();
|
||||
$scope.$close();
|
||||
});
|
||||
};
|
||||
|
||||
$scope.reportAbuse = function(reporter, message, groupId) {
|
||||
|
||||
Reference in New Issue
Block a user