Files
doneit-web/src/app/module/user/data/datasource/user-remote-repository.service.ts
T

40 lines
1.0 KiB
TypeScript
Raw Normal View History

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';
@Injectable({
providedIn: 'root'
})
export class UserRemoteRepositoryService {
constructor(
private httpService: HttpService
) { }
getUserProfilePhoto(guid: string) {
const geturl = environment.apiURL + 'UserAuthentication/GetPhoto';
const params = {
UserPhoto: guid
}
return this.httpService.get<string>(`${geturl}`, params);
}
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
};
return this.httpService.post<string>(`${geturl}`, data, options);
}
}