From e8066ab04314b2c57535038a5efe1d419dc3322a Mon Sep 17 00:00:00 2001 From: Hariom Vashista Date: Sun, 8 Dec 2024 22:04:44 +0530 Subject: [PATCH] Updated deprecated API endpoint from /users/self to /users?profile=true (#960) --- app/adapters/user.js | 2 +- app/components/debug-grids.js | 2 +- app/controllers/goto.js | 2 +- app/routes/intro.js | 2 +- app/services/login.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/adapters/user.js b/app/adapters/user.js index 48be8bdc..f7eac5d5 100644 --- a/app/adapters/user.js +++ b/app/adapters/user.js @@ -16,6 +16,6 @@ export default class UserAdapter extends ApplicationAdapter { } urlForUpdateRecord() { - return `${this.host}/users/self`; + return `${this.host}/users?profile=true`; } } diff --git a/app/components/debug-grids.js b/app/components/debug-grids.js index 02f3de3e..324fd6f7 100644 --- a/app/components/debug-grids.js +++ b/app/components/debug-grids.js @@ -59,7 +59,7 @@ export default class DebugGridsComponent extends Component { const previousState = target.checked; try { - const response = await fetch(`${APPS.API_BACKEND}/users/self?dev=true`, { + const response = await fetch(`${APPS.API_BACKEND}/users?profile=true`, { method: 'PATCH', credentials: 'include', headers: { diff --git a/app/controllers/goto.js b/app/controllers/goto.js index fffb071d..2224c7b2 100644 --- a/app/controllers/goto.js +++ b/app/controllers/goto.js @@ -52,7 +52,7 @@ export default class GotoController extends Controller { } async getSelfUser() { - const response = await fetch(`${APPS.API_BACKEND}/users/self`, { + const response = await fetch(`${APPS.API_BACKEND}/users?profile=true`, { method: 'GET', headers: { 'Content-Type': 'application/json', diff --git a/app/routes/intro.js b/app/routes/intro.js index ec135241..89e42fe5 100644 --- a/app/routes/intro.js +++ b/app/routes/intro.js @@ -24,7 +24,7 @@ export default class IntroRoute extends Route { let userResponse; let userData; - userResponse = await fetch(`${APPS.API_BACKEND}/users/self`, { + userResponse = await fetch(`${APPS.API_BACKEND}/users?profile=true`, { credentials: 'include', }); userData = await userResponse.json(); diff --git a/app/services/login.js b/app/services/login.js index e8485139..8dfc05bc 100644 --- a/app/services/login.js +++ b/app/services/login.js @@ -21,7 +21,7 @@ export default class LoginService extends Service { checkAuth() { //TODO: try working this with ember-data - fetch(`${APPS.API_BACKEND}/users/self`, { + fetch(`${APPS.API_BACKEND}/users?profile=true`, { credentials: 'include', headers: this.buildHeaders(), })