logs.service.ts 659B

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 { Log } from './log.model';
  6. @Injectable({ providedIn: 'root' })
  7. export class LogsService {
  8. constructor(private http: HttpClient) {}
  9. changeLevel(log: Log): Observable<HttpResponse<any>> {
  10. return this.http.put(SERVER_API_URL + 'management/logs', log, { observe: 'response' });
  11. }
  12. findAll(): Observable<HttpResponse<Log[]>> {
  13. return this.http.get<Log[]>(SERVER_API_URL + 'management/logs', { observe: 'response' });
  14. }
  15. }