sync notification UI with backend changes
This commit is contained in:
@@ -1172,7 +1172,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.getNotifications = function (acknowledged, page, perPage, callback) {
|
||||
Client.prototype.getNotifications = function (options, page, perPage, callback) {
|
||||
var config = {
|
||||
params: {
|
||||
page: page,
|
||||
@@ -1180,7 +1180,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
}
|
||||
};
|
||||
|
||||
if (typeof acknowledged === 'boolean') config.params.acknowledged = acknowledged;
|
||||
if (typeof options.acknowledged === 'boolean') config.params.acknowledged = options.acknowledged;
|
||||
|
||||
get('/api/v1/notifications', config, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
@@ -1190,8 +1190,8 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.ackNotification = function (notificationId, callback) {
|
||||
post('/api/v1/notifications/' + notificationId, {}, null, function (error, data, status) {
|
||||
Client.prototype.ackNotification = function (notificationId, acknowledged, callback) {
|
||||
post('/api/v1/notifications/' + notificationId, { acknowledged: acknowledged }, null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 204) return callback(new ClientError(status));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user