<commit_before>﻿import { Injectable } from '@angular/core';
import { Http, Headers, RequestOptions, Response } from '@angular/http';
import { Observable } from 'rxjs/Observable';

import { environment } from '../../environments/environment';
import { User } from '../_models';
import { Users } from '../_models/users';

@Injectable()
export class UserService {
    constructor(private http: Http) { }

    getAll(): Observable<Users> {
        return this.http
            .get(environment.apiUrl + '/users', this.jwt())
            .map((response: Response) => response.json());
    }

    getById(id: string): Observable<User> {
        return this.http
            .get(environment.apiUrl + '/users/' + id, this.jwt())
            .map((response: Response) => response.json());
    }

    create(user: User): Observable<User> {
        console.log(JSON.stringify(user, null, 4));
        let formData:FormData = new FormData();
        formData.append('userName', user.userName);
        formData.append('password', <PASSWORD>);
        formData.append('firstName', user.firstName);
        formData.append('lastName', user.lastName);
        formData.append('country', user.country);
        formData.append('birthdate', user.birthdate);
        formData.append('email', user.email);
        formData.append('avatar', user.avatar);
        let headers = new Headers();
        headers.append('Content-Type', 'multipart/form-data');
        let options = new RequestOptions({ headers: headers });
        return this.http.post(`${environment.apiUrl}/users/`, formData, this.jwt())
            .map(res => res.json());
    }

    update(user: User): Observable<User> {
        return this.http
            .put(environment.apiUrl + '/users/' + user.id, user, this.jwt())
            .map((response: Response) => response.json());
    }
<commit_msg>Delete console log<commit_after>﻿import { Injectable } from '@angular/core';
import { Http, Headers, RequestOptions, Response } from '@angular/http';
import { Observable } from 'rxjs/Observable';

import { environment } from '../../environments/environment';
import { User } from '../_models';
import { Users } from '../_models/users';

@Injectable()
export class UserService {
    constructor(private http: Http) { }

    getAll(): Observable<Users> {
        return this.http
            .get(environment.apiUrl + '/users', this.jwt())
            .map((response: Response) => response.json());
    }

    getById(id: string): Observable<User> {
        return this.http
            .get(environment.apiUrl + '/users/' + id, this.jwt())
            .map((response: Response) => response.json());
    }

    create(user: User): Observable<User> {
        let formData:FormData = new FormData();
        formData.append('userName', user.userName);
        formData.append('password', <PASSWORD>);
        formData.append('firstName', user.firstName);
        formData.append('lastName', user.lastName);
        formData.append('country', user.country);
        formData.append('birthdate', user.birthdate);
        formData.append('email', user.email);
        formData.append('avatar', user.avatar);
        let headers = new Headers();
        headers.append('Content-Type', 'multipart/form-data');
        let options = new RequestOptions({ headers: headers });
        return this.http.post(`${environment.apiUrl}/users/`, formData, this.jwt())
            .map(res => res.json());
    }

    update(user: User): Observable<User> {
        return this.http
            .put(environment.apiUrl + '/users/' + user.id, user, this.jwt())
            .map((response: Response) => response.json());
    }

{'fraction_non_alphanumeric': 0.16452231042978374, 'fraction_numerical': 0.0002737476047084588, 'mean_word_length': 2.838235294117647, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 21, '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': '4718869', 'n_tokens_mistral': 1038, 'n_tokens_neox': 1028, 'n_words': 225}