account.service.ts 676B

1234567891011121314151617181920
  1. import { Injectable } from '@angular/core';
  2. import { HttpClient, HttpResponse } from '@angular/common/http';
  3. import { Observable } from 'rxjs';
  4. import { SERVER_API_URL } from 'app/app.constants';
  5. import { Account } from 'app/core/user/account.model';
  6. @Injectable({ providedIn: 'root' })
  7. export class AccountService {
  8. constructor(private http: HttpClient) {}
  9. get(): Observable<HttpResponse<Account>> {
  10. return this.http.get<Account>(SERVER_API_URL + 'api/account', { observe: 'response' });
  11. }
  12. save(account: any): Observable<HttpResponse<any>> {
  13. return this.http.post(SERVER_API_URL + 'api/account', account, { observe: 'response' });
  14. }
  15. }