profile update works

This commit is contained in:
2025-07-03 23:47:22 +05:00
parent 77e3ca0f18
commit e2b696655d
5 changed files with 542 additions and 5 deletions

View File

@@ -7,11 +7,35 @@ class ApiService {
}
async updateProfile(data) {
return authService.updateProfile(data);
try {
const response = await authService.updateProfile(data);
// Server returns { message: "Successfully updated profile" }
return {
success: true,
message: response.message || 'Profile updated successfully',
};
} catch (error) {
return {
success: false,
error: error.message,
};
}
}
async changePassword(currentPassword, newPassword) {
return authService.changePassword(currentPassword, newPassword);
try {
const response = await authService.changePassword(currentPassword, newPassword);
// Assume server returns { message: "Successfully changed password" }
return {
success: true,
message: response.message || 'Password changed successfully',
};
} catch (error) {
return {
success: false,
error: error.message,
};
}
}
async deleteAccount() {

View File

@@ -114,7 +114,7 @@ class AuthService {
}
async updateProfile(data) {
return this.makeRequest('/profile', data, true, 'PUT');
return this.makeRequest('/profile', data, true, 'POST');
}
async getTransactions(page = 1, limit = 20) {