mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 23:27:26 +01:00
rename website/client to website/client-old
This commit is contained in:
22
website/client-old/js/services/userNotificationsService.js
Normal file
22
website/client-old/js/services/userNotificationsService.js
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('habitrpg')
|
||||
.factory('UserNotifications', ['$http',
|
||||
function userNotificationsFactory($http) {
|
||||
|
||||
var lastRead; // keep track of last notification ID to avoid reding it twice
|
||||
|
||||
function readNotification (notificationId) {
|
||||
if (lastRead === notificationId) return;
|
||||
lastRead = notificationId;
|
||||
|
||||
return $http({
|
||||
method: 'POST',
|
||||
url: 'api/v3/notifications/' + notificationId + '/read',
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
readNotification: readNotification,
|
||||
};
|
||||
}]);
|
||||
Reference in New Issue
Block a user