feat: implement email change functionality with verification modal in profile settings
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user