Skip to content

Commit 1fbd8d9

Browse files
author
sachin-maheshwari
authored
Merge pull request #1951 from appirio-tech/hotfix/v5-notifications-endpoint-change
[Production Deployment] hotfix: v5 deployment - changes in tc-notifications endpoints.
2 parents 4462e2b + 023ff33 commit 1fbd8d9

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

config/constants/dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ module.exports = {
4444
IBM_COGNITIVE_PROGRAM_ID : 3449,
4545
HEAP_ANALYTICS_APP_ID : '4153837120',
4646

47-
TC_NOTIFICATION_URL: 'https://api.topcoder-dev.com'
47+
TC_NOTIFICATION_URL: 'https://api.topcoder-dev.com/v5/notifications'
4848
}

config/constants/master.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ module.exports = {
4343
IBM_COGNITIVE_PROGRAM_ID : 3449,
4444
HEAP_ANALYTICS_APP_ID : '638908330',
4545

46-
TC_NOTIFICATION_URL: 'https://api.topcoder.com'
46+
TC_NOTIFICATION_URL: 'https://api.topcoder.com/v5/notifications'
4747
}

config/constants/qa.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ module.exports = {
4242
IBM_COGNITIVE_PROGRAM_ID : 3449,
4343
HEAP_ANALYTICS_APP_ID : '4153837120',
4444

45-
TC_NOTIFICATION_URL: 'http://api.topcoder-dev.com/'
45+
TC_NOTIFICATION_URL: 'https://api.topcoder-dev.com/v5/notifications'
4646
}

src/config/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ export const ACCOUNTS_APP_REGISTER_URL = process.env.ACCOUNTS_APP_REGISTER_URL |
297297
export const TC_API_URL = `https://api.${DOMAIN}`
298298
export const DIRECT_PROJECT_URL = `https://www.${DOMAIN}/direct/projectOverview?formData.projectId=`
299299
export const SALESFORCE_PROJECT_LEAD_LINK = process.env.SALESFORCE_PROJECT_LEAD_LINK
300-
export const TC_NOTIFICATION_URL = process.env.TC_NOTIFICATION_URL || TC_API_URL
300+
export const TC_NOTIFICATION_URL = process.env.TC_NOTIFICATION_URL || `${TC_API_URL}/v5/notifications`
301301

302302
export const PROJECT_NAME_MAX_LENGTH = 255
303303
export const PROJECT_REF_CODE_MAX_LENGTH = 32

src/routes/notifications/services/notifications.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ import { prepareNotifications } from '../helpers/notifications'
1010
// the id can be either: null/undefined (mark all); notification id; or '-' separated ids, e.g. '123-456-789'
1111
const markNotificationsRead = (id) => {
1212
if (id) {
13-
return axios.put(`${TC_NOTIFICATION_URL}/notifications/${id}/read`)
13+
return axios.put(`${TC_NOTIFICATION_URL}/${id}/read`)
1414
} else {
15-
return axios.put(`${TC_NOTIFICATION_URL}/notifications/read`)
15+
return axios.put(`${TC_NOTIFICATION_URL}/read`)
1616
}
1717
}
1818

1919
// the id can be either: notification id; or '-' separated ids, e.g. '123-456-789'
2020
const markNotificationsSeen = (id) => {
21-
return axios.put(`${TC_NOTIFICATION_URL}/notifications/${id}/seen`)
21+
return axios.put(`${TC_NOTIFICATION_URL}/${id}/seen`)
2222
}
2323

2424
const getNotifications = () => {
25-
return axios.get(`${TC_NOTIFICATION_URL}/notifications?read=false&limit=${NOTIFICATIONS_LIMIT}`)
25+
return axios.get(`${TC_NOTIFICATION_URL}/list?read=false&limit=${NOTIFICATIONS_LIMIT}`)
2626
.then(resp => prepareNotifications(resp.data.items))
2727
}
2828

src/routes/settings/services/settings.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const changePassword = (password) => {
6262
}
6363

6464
const getNotificationSettings = () => {
65-
return axios.get(`${TC_NOTIFICATION_URL}/notificationsettings`)
65+
return axios.get(`${TC_NOTIFICATION_URL}/settings`)
6666
.then(resp => resp.data)
6767
}
6868

@@ -101,7 +101,7 @@ const saveNotificationSettings = (data) => {
101101
body.push({ topic, deliveryMethod: 'email', value: data[topic] && data[topic].email === 'yes' ? 'yes' : 'no' })
102102
body.push({ topic, deliveryMethod: 'web', value: data[topic] && data[topic].web === 'yes' ? 'yes' : 'no' })
103103
})
104-
return axios.put(`${TC_NOTIFICATION_URL}/notificationsettings`, body)
104+
return axios.put(`${TC_NOTIFICATION_URL}/settings`, body)
105105
}
106106

107107
export default {

0 commit comments

Comments
 (0)