Skip to content

Commit 8ee1b7f

Browse files
authored
Updated deprecated API endpoint users/self to users?profile=true (#931)
1 parent b2459fd commit 8ee1b7f

File tree

15 files changed

+17
-16
lines changed

15 files changed

+17
-16
lines changed

__tests__/applications/applications.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe('Applications page', () => {
6060
'Access-Control-Allow-Headers': 'Content-Type, Authorization',
6161
},
6262
});
63-
} else if (url === `${STAGING_API_URL}/users/self`) {
63+
} else if (url === `${STAGING_API_URL}/users?profile=true`) {
6464
interceptedRequest.respond({
6565
status: 200,
6666
contentType: 'application/json',

__tests__/groups/group.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe('Discord Groups Page', () => {
5151
},
5252
body: JSON.stringify(allUsersData),
5353
});
54-
} else if (url === `${STAGING_API_URL}/users/self`) {
54+
} else if (url === `${STAGING_API_URL}/users?profile=true`) {
5555
interceptedRequest.respond({
5656
status: 200,
5757
contentType: 'application/json',

__tests__/home/home.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe('Home Page', () => {
2121
await page.setRequestInterception(true);
2222
page.on('request', (interceptedRequest) => {
2323
const url = interceptedRequest.url();
24-
if (url === `${STAGING_API_URL}/users/self`) {
24+
if (url === `${STAGING_API_URL}/users?profile=true`) {
2525
interceptedRequest.respond({
2626
status: 200,
2727
contentType: 'application/json',

__tests__/task-requests/task-requestDetails.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('Request container for non-super users', () => {
2525
await page.setRequestInterception(true);
2626
page.on('request', (interceptedRequest) => {
2727
const url = interceptedRequest.url();
28-
if (url == `${STAGING_API_URL}/users/self`) {
28+
if (url == `${STAGING_API_URL}/users?profile=true`) {
2929
interceptedRequest.respond({
3030
...defaultMockResponseHeaders,
3131
body: JSON.stringify(user),

__tests__/user-details/task-duedate-hover.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe('Tasks On User Management Page', () => {
4545
body: JSON.stringify(userDetails),
4646
});
4747
} else if (
48-
url === `${STAGING_API_URL}/users/self` ||
48+
url === `${STAGING_API_URL}/users?profile=true` ||
4949
url === `${STAGING_API_URL}/users/ankush`
5050
) {
5151
interceptedRequest.respond({

__tests__/users/onboarding-31-days-multiple-selections.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe('Tests the "Onboarding > 31 Days" Filter', () => {
3333
},
3434
body: JSON.stringify(userDetailsApi),
3535
});
36-
} else if (url === `${STAGING_API_URL}/users/self`) {
36+
} else if (url === `${STAGING_API_URL}/users?profile=true`) {
3737
// When we encounter the respective api call we respond with the below response
3838
interceptedRequest.respond({
3939
status: 200,

__tests__/users/onboarding31days.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('Tests the "Onboarding > 31 Days" Filter', () => {
3434
},
3535
body: JSON.stringify(userDetailsApi),
3636
});
37-
} else if (url === `${STAGING_API_URL}/users/self`) {
37+
} else if (url === `${STAGING_API_URL}/users?profile=true`) {
3838
// When we encounter the respective api call we respond with the below response
3939
interceptedRequest.respond({
4040
status: 200,

admin-panel/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const loading = document.getElementById('loading');
55
const selectElement = document.getElementById('select-tags');
66
(async function setAuth() {
77
try {
8-
const res = await fetch(`${API_BASE_URL}/users/self`, {
8+
const res = await fetch(`${API_BASE_URL}/users?profile=true`, {
99
method: 'GET',
1010
credentials: 'include',
1111
headers: {

applications/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ async function getApplicationById(applicationId) {
6868

6969
async function getIsSuperUser() {
7070
try {
71-
const res = await fetch(`${BASE_URL}/users/self`, {
71+
const res = await fetch(`${BASE_URL}/users?profile=true`, {
7272
method: 'GET',
7373
credentials: 'include',
7474
headers: {

groups/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ async function getMembers() {
1717
}
1818
async function getUserSelf() {
1919
try {
20-
const res = await fetch(`${BASE_URL}/users/self`, {
20+
const res = await fetch(`${BASE_URL}/users?profile=true`, {
2121
method: 'GET',
2222
credentials: 'include',
2323
headers: {

0 commit comments

Comments
 (0)