sync notification UI with backend changes

This commit is contained in:
Girish Ramakrishnan
2021-05-29 12:11:17 -07:00
parent 841c9bc261
commit 5aa6e18ea7
5 changed files with 38 additions and 68 deletions

View File

@@ -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));