<commit_before>import { Injectable } from '@angular/core';
import { Headers, Http } from '@angular/http';
import { Observable } from 'rxjs/Rx';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';

import { UserDetails } from '../shared/database/user-details';
import { DoctorProfiles } from '../shared/database/doctor-profiles';
import { SecurityService } from '../shared/services/security.service';
import { StaffInfo } from '../shared/database/staff-info';
import { PatientInfo } from '../shared/database/patient-info';
import { DoctorMedia } from '../shared/database/doctor-media';

@Injectable()
export class ProfileService {
    private url: string;

    constructor(private http: Http, private securityService: SecurityService) {
        this.url = this.securityService.baseUrl;
    }

    /**
     * GET userById from the server
     */
    getUserDetailsById(id: number): Observable<UserDetails> {
        console.log('one');
        const uri = `${this.url}/users/${id}`;
        let headers = new Headers();
        headers.append('Authorization', `${this.securityService.key} ${this.securityService.getCookie('token')}`);
        return this.http.get(uri, {headers: headers})
            .map(res => res.json() as UserDetails)
            .catch(this.handleError);
    }<commit_msg>Update profile.service.ts<commit_after>import { Injectable } from '@angular/core';
import { Headers, Http } from '@angular/http';
import { Observable } from 'rxjs/Rx';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';

import { UserDetails } from '../shared/database/user-details';
import { DoctorProfiles } from '../shared/database/doctor-profiles';
import { SecurityService } from '../shared/services/security.service';
import { StaffInfo } from '../shared/database/staff-info';
import { PatientInfo } from '../shared/database/patient-info';
import { DoctorMedia } from '../shared/database/doctor-media';

@Injectable()
export class ProfileService {
    private url: string;

    constructor(private http: Http, private securityService: SecurityService) {
        this.url = this.securityService.baseUrl;
    }

    /**
     * GET userById from the server
     */
    getUserDetailsById(id: number): Observable<UserDetails> {
        const uri = `${this.url}/users/${id}`;
        let headers = new Headers();
        headers.append('Authorization', `${this.securityService.key} ${this.securityService.getCookie('token')}`);
        return this.http.get(uri, {headers: headers})
            .map(res => res.json() as UserDetails)
            .catch(this.handleError);
    }
{'fraction_non_alphanumeric': 0.15319476520400307, 'fraction_numerical': 0.0, 'mean_word_length': 3.5596491228070177, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4428812', 'n_tokens_mistral': 726, 'n_tokens_neox': 728, 'n_words': 168}