feat: add consumer profile management; implement profile form, reset password functionality, and API integration

This commit is contained in:
2026-05-18 10:30:25 +03:30
parent 78501b907b
commit 79c00e0149
15 changed files with 309 additions and 5 deletions
@@ -0,0 +1,22 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { CONSUMER_PROFILE_API_ROUTES } from '../constants';
import { IProfileRequestPayload, IProfileResponse, IResetPasswordRequest } from '../models';
@Injectable({ providedIn: 'root' })
export class ProfileService {
constructor(private readonly http: HttpClient) {}
getInfo(): Observable<IProfileResponse> {
return this.http.get<IProfileResponse>(CONSUMER_PROFILE_API_ROUTES.info());
}
updateProfile(payload: IProfileRequestPayload): Observable<IProfileResponse> {
return this.http.patch<IProfileResponse>(CONSUMER_PROFILE_API_ROUTES.updateInfo(), payload);
}
resetPassword(payload: IResetPasswordRequest): Observable<unknown> {
return this.http.put(CONSUMER_PROFILE_API_ROUTES.resetPassword(), payload);
}
}