Parcourir la source

Update `markAsReadByKeyOnly` url.

Shane Kilkelly il y a 10 ans
Parent
commit
a7bc8bffe0

+ 6 - 6
services/web/app/coffee/Features/Notifications/NotificationsHandler.coffee

@@ -10,10 +10,10 @@ makeRequest = (opts, callback)->
 	else
 	else
 		request(opts, callback)
 		request(opts, callback)
 
 
-module.exports = 
+module.exports =
 
 
 	getUserNotifications: (user_id, callback)->
 	getUserNotifications: (user_id, callback)->
-		opts = 
+		opts =
 			uri: "#{settings.apis.notifications?.url}/user/#{user_id}"
 			uri: "#{settings.apis.notifications?.url}/user/#{user_id}"
 			json: true
 			json: true
 			timeout: oneSecond
 			timeout: oneSecond
@@ -30,7 +30,7 @@ module.exports =
 				callback(null, unreadNotifications)
 				callback(null, unreadNotifications)
 
 
 	createNotification: (user_id, key, templateKey, messageOpts, callback)->
 	createNotification: (user_id, key, templateKey, messageOpts, callback)->
-		opts = 
+		opts =
 			uri: "#{settings.apis.notifications?.url}/user/#{user_id}"
 			uri: "#{settings.apis.notifications?.url}/user/#{user_id}"
 			timeout: oneSecond
 			timeout: oneSecond
 			method:"POST"
 			method:"POST"
@@ -43,7 +43,7 @@ module.exports =
 		makeRequest opts, callback
 		makeRequest opts, callback
 
 
 	markAsReadWithKey: (user_id, key, callback)->
 	markAsReadWithKey: (user_id, key, callback)->
-		opts = 
+		opts =
 			uri: "#{settings.apis.notifications?.url}/user/#{user_id}"
 			uri: "#{settings.apis.notifications?.url}/user/#{user_id}"
 			method: "DELETE"
 			method: "DELETE"
 			timeout: oneSecond
 			timeout: oneSecond
@@ -52,7 +52,7 @@ module.exports =
 			}
 			}
 		logger.log user_id:user_id, key:key, "sending mark notification as read with key to notifications api"
 		logger.log user_id:user_id, key:key, "sending mark notification as read with key to notifications api"
 		makeRequest opts, callback
 		makeRequest opts, callback
-	
+
 
 
 	markAsRead: (user_id, notification_id, callback)->
 	markAsRead: (user_id, notification_id, callback)->
 		opts =
 		opts =
@@ -66,7 +66,7 @@ module.exports =
 	# should not be exposed to user via ui/router
 	# should not be exposed to user via ui/router
 	markAsReadByKeyOnly: (key, callback)->
 	markAsReadByKeyOnly: (key, callback)->
 		opts =
 		opts =
-			uri: "#{settings.apis.notifications?.url}/notification/key/#{key}"
+			uri: "#{settings.apis.notifications?.url}/key/#{key}"
 			method: "DELETE"
 			method: "DELETE"
 			timeout: oneSecond
 			timeout: oneSecond
 		logger.log {key:key}, "sending mark notification as read with key-only to notifications api"
 		logger.log {key:key}, "sending mark notification as read with key-only to notifications api"

+ 1 - 1
services/web/test/UnitTests/coffee/Notifications/NotificationsHandlerTests.coffee

@@ -77,7 +77,7 @@ describe 'NotificationsHandler', ->
 		it 'should send a delete request when a delete has been received to mark a notification', (done)->
 		it 'should send a delete request when a delete has been received to mark a notification', (done)->
 			@handler.markAsReadByKeyOnly @key, =>
 			@handler.markAsReadByKeyOnly @key, =>
 				opts =
 				opts =
-					uri: "#{notificationUrl}/notification/key/#{@key}"
+					uri: "#{notificationUrl}/key/#{@key}"
 					timeout:1000
 					timeout:1000
 					method: "DELETE"
 					method: "DELETE"
 				@request.calledWith(opts).should.equal true
 				@request.calledWith(opts).should.equal true