Project

General

Profile

« Previous | Next » 

Revision 55964

[Library|Trunk]

Merge into trunk branch angular7 rev 55729

View differences:

curator.service.ts
1 1
import {Injectable} from '@angular/core';
2
import {HttpClient, HttpHeaders} from '@angular/common/http';
2
import {HttpClient} from '@angular/common/http';
3 3
import {BehaviorSubject, Observable} from 'rxjs';
4 4
import {Curator} from '../../utils/entities/CuratorInfo';
5 5
import {EnvProperties} from '../../utils/properties/env-properties';
6
import {COOKIE} from '../../login/utils/helper.class';
6
import {CustomOptions} from "../../services/servicesUtils/customOptions.class";
7 7

  
8 8
@Injectable()
9 9
export class CuratorService {
......
34 34
  }
35 35

  
36 36
  public updateCurator(url: string, curator: Curator) {
37
    return this.http.post<Curator>(url, curator, this.getAuthOptions());
37
    return this.http.post<Curator>(url, curator, CustomOptions.getAuthOptions());
38 38
  }
39 39

  
40 40
  public getCurator(properties: EnvProperties, url: string): Observable<Curator> {
41 41
    return this.http.get<Curator>((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url);
42 42
  }
43 43

  
44
  // TODO remove and use CustomOptions.getAuthOptions()
45
  private getAuthOptions(): any {
46
     const httpOptions = {
47
      headers: new HttpHeaders({
48
        'X-XSRF-TOKEN': COOKIE.getCookie(COOKIE.cookieName_id),
49
      }), withCredentials: true
50
    };
51
    return httpOptions;
52
  }
53 44
}

Also available in: Unified diff