Fix profile API endpoint URLs

- Remove /api prefix from profile endpoints since API_BASE_URL already includes it
- Fixes /api/api/profile 404 error
parent c5246738
...@@ -1576,7 +1576,7 @@ let profileData = null; ...@@ -1576,7 +1576,7 @@ let profileData = null;
*/ */
async function getProfile() { async function getProfile() {
try { try {
const response = await apiRequest('/api/profile'); const response = await apiRequest('/profile');
if (response.success) { if (response.success) {
profileData = response.profile; profileData = response.profile;
updateProfileDisplay(); updateProfileDisplay();
...@@ -1639,7 +1639,7 @@ function updateProfileDisplay() { ...@@ -1639,7 +1639,7 @@ function updateProfileDisplay() {
*/ */
async function changePassword(currentPassword, newPassword) { async function changePassword(currentPassword, newPassword) {
try { try {
const response = await apiRequest('/api/profile/password', 'POST', { const response = await apiRequest('/profile/password', 'POST', {
current_password: currentPassword, current_password: currentPassword,
new_password: newPassword new_password: newPassword
}); });
...@@ -1663,7 +1663,7 @@ async function changePassword(currentPassword, newPassword) { ...@@ -1663,7 +1663,7 @@ async function changePassword(currentPassword, newPassword) {
*/ */
async function requestEmailChange(newEmail) { async function requestEmailChange(newEmail) {
try { try {
const response = await apiRequest('/api/profile/email', 'POST', { const response = await apiRequest('/profile/email', 'POST', {
new_email: newEmail new_email: newEmail
}); });
...@@ -1686,7 +1686,7 @@ async function requestEmailChange(newEmail) { ...@@ -1686,7 +1686,7 @@ async function requestEmailChange(newEmail) {
*/ */
async function verifyEmailChange(token) { async function verifyEmailChange(token) {
try { try {
const response = await apiRequest('/api/profile/email/verify', 'POST', { const response = await apiRequest('/profile/email/verify', 'POST', {
token: token token: token
}); });
...@@ -1718,7 +1718,7 @@ async function updateAvatar(avatarData = null, avatarUrl = null) { ...@@ -1718,7 +1718,7 @@ async function updateAvatar(avatarData = null, avatarUrl = null) {
payload.avatar_url = avatarUrl; payload.avatar_url = avatarUrl;
} }
const response = await apiRequest('/api/profile/avatar', 'POST', payload); const response = await apiRequest('/profile/avatar', 'POST', payload);
if (response.success) { if (response.success) {
if (profileData) { if (profileData) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment