feat: add consumer profile management; implement profile form, reset password functionality, and API integration
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user