26 lines
613 B
TypeScript
26 lines
613 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { ReplaySubject, of } from 'rxjs';
|
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
|
|
import { environment } from '../../environments/environment';
|
|
|
|
@Injectable({
|
|
providedIn: 'root',
|
|
})
|
|
export class UserService {
|
|
|
|
constructor(private http: HttpClient) {
|
|
}
|
|
|
|
get() {
|
|
return this.http.get(environment.apiUrl + "/u");
|
|
}
|
|
|
|
getUser(username: string) {
|
|
return this.http.get(environment.apiUrl + "/u/" + username);
|
|
}
|
|
|
|
update(user: any) {
|
|
return this.http.post(environment.apiUrl + "/u", user);
|
|
}
|
|
} |