profile update works
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user