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;
*/
async function getProfile() {
try {
const response = await apiRequest('/api/profile');
const response = await apiRequest('/profile');
if (response.success) {
profileData = response.profile;
updateProfileDisplay();
......@@ -1639,7 +1639,7 @@ function updateProfileDisplay() {
*/
async function changePassword(currentPassword, newPassword) {
try {
const response = await apiRequest('/api/profile/password', 'POST', {
const response = await apiRequest('/profile/password', 'POST', {
current_password: currentPassword,
new_password: newPassword
});
......@@ -1663,7 +1663,7 @@ async function changePassword(currentPassword, newPassword) {
*/
async function requestEmailChange(newEmail) {
try {
const response = await apiRequest('/api/profile/email', 'POST', {
const response = await apiRequest('/profile/email', 'POST', {
new_email: newEmail
});
......@@ -1686,7 +1686,7 @@ async function requestEmailChange(newEmail) {
*/
async function verifyEmailChange(token) {
try {
const response = await apiRequest('/api/profile/email/verify', 'POST', {
const response = await apiRequest('/profile/email/verify', 'POST', {
token: token
});
......@@ -1718,7 +1718,7 @@ async function updateAvatar(avatarData = null, avatarUrl = null) {
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 (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