feat: implement email change functionality with verification modal in profile settings

This commit is contained in:
pradeepkumar
2026-04-20 14:07:33 +05:30
parent a292bdc694
commit 2337f5646f
2 changed files with 130 additions and 6 deletions

View File

@@ -44,6 +44,11 @@ export interface VerifyEmailRequest {
token: string;
}
export interface ChangeEmailRequest {
newEmail: string;
password: string;
}
export interface MessageResponse {
message: string;
}
@@ -99,6 +104,14 @@ class AuthService {
return response.data;
}
async requestEmailChange(data: ChangeEmailRequest): Promise<ApiResponse<MessageResponse>> {
const response = await api.post<ApiResponse<MessageResponse>>(
`${this.basePath}/change-email`,
data
);
return response.data;
}
async getCurrentUser(): Promise<ApiResponse<AuthUser>> {
const response = await api.get<ApiResponse<AuthUser>>(`${this.basePath}/me`);
return response.data;