mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Merge branch 'develop' of github.com:HabitRPG/habitrpg into common-convert
Conflicts: src/controllers/auth.js src/controllers/challenges.js src/controllers/groups.js src/controllers/members.js src/controllers/payments/index.js src/controllers/user.js src/middleware.js src/models/user.js
This commit is contained in:
@@ -242,5 +242,14 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
|
||||
window.location.href = url;
|
||||
window.location.reload(false);
|
||||
}
|
||||
|
||||
// Universal method for sending HTTP methods
|
||||
$rootScope.http = function(method, route, data, alertMsg){
|
||||
$http[method](ApiUrl.get() + route, data).success(function(){
|
||||
if (alertMsg) Notification.text(window.env.t(alertMsg));
|
||||
User.sync();
|
||||
});
|
||||
// error will be handled via $http interceptor
|
||||
}
|
||||
}
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user