Add API calls for profile component

This commit is contained in:
kevinpauer
2022-04-05 19:23:52 +02:00
parent 16ad83ae40
commit 4c7506d8b2
8 changed files with 113 additions and 63 deletions

View File

@@ -16,42 +16,6 @@ export class DataService {
private tokenStorage: TokenStorageService
) {}
/**
* @returns Observable
*/
public getUserData(): Observable<any> {
return this.http.get(API_URL + 'user', {
headers: new HttpHeaders({
'Content-Type': 'application/json',
Authorization: 'Bearer ' + this.tokenStorage.getToken(),
}),
responseType: 'text',
});
}
/**
* @param {string} email
* @param {string} username
* @param {string} password
* @returns Observable
*/
public updateUserData(
email: string,
username: string,
password: string
): Observable<any> {
return this.http.put(API_URL + 'user', {
headers: new HttpHeaders({
'Content-Type': 'application/json',
Authorization: 'Bearer ' + this.tokenStorage.getToken(),
}),
responseType: 'text',
email,
username,
password,
});
}
/**
* @returns Observable
*/