diff --git a/app/controllers/profile.js b/app/controllers/profile.js index d9bbd6f4..b0ecbabe 100644 --- a/app/controllers/profile.js +++ b/app/controllers/profile.js @@ -148,7 +148,7 @@ export default class ProfileController extends Controller { e.preventDefault(); const cleanReqObject = this.removeEmptyFields(this.formData); try { - const response = await fetch(`${BASE_URL}/users/self`, { + const response = await fetch(`${BASE_URL}/users?profile=true`, { method: 'PATCH', body: JSON.stringify(cleanReqObject), headers: { diff --git a/app/routes/application.js b/app/routes/application.js index df7295f6..a099ea39 100644 --- a/app/routes/application.js +++ b/app/routes/application.js @@ -13,7 +13,7 @@ export default class ApplicationRoute extends Route { const defaultPicture = 'dummyProfilePicture.png'; try { - const response = await fetch(`${API_BASE_URL}/users/self`, { + const response = await fetch(`${API_BASE_URL}/users?profile=true`, { credentials: 'include', }); const userData = await response.json(); diff --git a/app/routes/discord.js b/app/routes/discord.js index 1b126fa0..c1488852 100644 --- a/app/routes/discord.js +++ b/app/routes/discord.js @@ -22,9 +22,12 @@ export default class DiscordRoute extends Route { } ); - const userResponse = await fetch(`${ENV.BASE_API_URL}/users/self`, { - credentials: 'include', - }); + const userResponse = await fetch( + `${ENV.BASE_API_URL}/users?profile=true`, + { + credentials: 'include', + } + ); const externalAccountData = await externalAccountResponse.json(); const userData = await userResponse.json(); diff --git a/app/routes/identity.js b/app/routes/identity.js index abb703f5..700e5d91 100644 --- a/app/routes/identity.js +++ b/app/routes/identity.js @@ -8,7 +8,7 @@ export default class IdentityRoute extends Route { @service toast; async model() { try { - const response = await fetch(`${ENV.BASE_API_URL}/users/self`, { + const response = await fetch(`${ENV.BASE_API_URL}/users?profile=true`, { credentials: 'include', }); const userData = await response.json(); diff --git a/app/routes/mobile.js b/app/routes/mobile.js index 9d73938c..7d8f177c 100644 --- a/app/routes/mobile.js +++ b/app/routes/mobile.js @@ -11,7 +11,7 @@ export default class MobileRoute extends Route { model = async () => { try { - const response = await fetch(`${API_BASE_URL}/users/self`, { + const response = await fetch(`${API_BASE_URL}/users?profile=true`, { credentials: 'include', }); const userData = await response.json(); diff --git a/app/routes/new-signup.js b/app/routes/new-signup.js index e4fd2c7f..d59f9ab3 100644 --- a/app/routes/new-signup.js +++ b/app/routes/new-signup.js @@ -13,7 +13,7 @@ export default class NewSignupRoute extends Route { async model() { try { this.analytics.trackEvent(SIGNUP.PAGE_LOADED); - const response = await fetch(`${ENV.BASE_API_URL}/users/self`, { + const response = await fetch(`${ENV.BASE_API_URL}/users?profile=true`, { credentials: 'include', }); const userData = await response.json(); diff --git a/app/routes/profile.js b/app/routes/profile.js index 7254d6ce..5871d403 100644 --- a/app/routes/profile.js +++ b/app/routes/profile.js @@ -12,7 +12,7 @@ export default class ProfileRoute extends Route { credentials: 'include', }); const { developerRoleExistsOnUser } = await res.json(); - const response = await fetch(`${ENV.BASE_API_URL}/users/self`, { + const response = await fetch(`${ENV.BASE_API_URL}/users?profile=true`, { credentials: 'include', }); const userData = await response.json(); diff --git a/app/routes/signup.js b/app/routes/signup.js index 9a47a457..c8c6f2c8 100644 --- a/app/routes/signup.js +++ b/app/routes/signup.js @@ -19,7 +19,7 @@ export default class SignupRoute extends Route { async model() { try { this.analytics.trackEvent(SIGNUP.PAGE_LOADED); - const response = await fetch(`${ENV.BASE_API_URL}/users/self`, { + const response = await fetch(`${ENV.BASE_API_URL}/users?profile=true`, { credentials: 'include', }); const userData = await response.json(); diff --git a/app/utils/register-api.js b/app/utils/register-api.js index 705c3e10..17d5fc41 100644 --- a/app/utils/register-api.js +++ b/app/utils/register-api.js @@ -3,7 +3,7 @@ import ENV from 'website-my/config/environment'; const { BASE_API_URL } = ENV; const registerUser = (user) => - fetch(`${BASE_API_URL}/users/self`, { + fetch(`${BASE_API_URL}/users?profile=true`, { method: 'PATCH', body: JSON.stringify(user), headers: { @@ -13,7 +13,7 @@ const registerUser = (user) => }); const newRegisterUser = async (signupDetails, roles) => { - const getResponse = await fetch(`${BASE_API_URL}/users/self`, { + const getResponse = await fetch(`${BASE_API_URL}/users?profile=true`, { method: 'GET', headers: { 'Content-Type': 'application/json',