2024-07-24 13:37:02 +01:00
|
|
|
import { Injectable } from '@angular/core';
|
|
|
|
|
import { HttpService } from 'src/app/services/http.service';
|
|
|
|
|
import { environment } from 'src/environments/environment';
|
|
|
|
|
import { IProfilePictureInputDTO } from '../dto/profilePictureInputDTO';
|
|
|
|
|
import { HttpHeaders } from '@angular/common/http';
|
2024-07-31 09:35:35 +01:00
|
|
|
import { TracingType } from 'src/app/services/monitoring/opentelemetry/tracer';
|
2024-07-24 13:37:02 +01:00
|
|
|
|
|
|
|
|
@Injectable({
|
|
|
|
|
providedIn: 'root'
|
|
|
|
|
})
|
|
|
|
|
export class UserRemoteRepositoryService {
|
|
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
|
private httpService: HttpService
|
|
|
|
|
) { }
|
|
|
|
|
|
2024-07-31 09:35:35 +01:00
|
|
|
getUserProfilePhoto(guid: string, tracing?: TracingType) {
|
2024-07-24 13:37:02 +01:00
|
|
|
const geturl = environment.apiURL + 'UserAuthentication/GetPhoto';
|
2024-07-31 09:35:35 +01:00
|
|
|
|
2024-07-24 13:37:02 +01:00
|
|
|
const params = {
|
|
|
|
|
UserPhoto: guid
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-31 09:35:35 +01:00
|
|
|
return this.httpService.get<string>(`${geturl}`, params, tracing);
|
2024-07-24 13:37:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
addUserProfilePhoto(data: IProfilePictureInputDTO) {
|
|
|
|
|
const geturl = environment.apiURL + 'UserAuthentication/AddPhoto';
|
|
|
|
|
|
|
|
|
|
let http = new HttpHeaders();
|
|
|
|
|
|
|
|
|
|
http = http.set('content-type', "application/json");
|
|
|
|
|
http = http.set('accept', "application/json");
|
|
|
|
|
let options = {
|
|
|
|
|
headers: http
|
|
|
|
|
};
|
2024-07-31 09:35:35 +01:00
|
|
|
|
2024-07-24 13:37:02 +01:00
|
|
|
return this.httpService.post<string>(`${geturl}`, data, options);
|
|
|
|
|
}
|
|
|
|
|
}
|