<commit_before>import { Restangular } from 'ng2-restangular';
import { Observable } from 'rxjs/Observable';

import { BaseEntity } from '../../model';

export abstract class RESTService<T extends BaseEntity, L extends Array<T>> {

  protected constructor(private restangularService: Restangular, public kind: String) {
  }

  get(id: string): Observable<T> {
    return this.restangularService.one( id ).get();
  }

  list(): Observable<L> {
    return this.restangularService.getList();
  }

  create(obj: T): Observable<T> {
    return this.restangularService.post( obj );
  }

  update(obj: T): Observable<T> {
    // return this.restangularService.customPUT(obj, obj.id);
    return this.restangularService.one( obj.id ).put();
  }

  delete(obj: T) {
    return this.restangularService.restangularizeElement(undefined, obj).remove();
    // return this.restangularService.one( obj.id ).delete();
  }

}
<commit_msg>No, this looks right according to the docs<commit_after>import { Restangular } from 'ng2-restangular';
import { Observable } from 'rxjs/Observable';

import { BaseEntity } from '../../model';

export abstract class RESTService<T extends BaseEntity, L extends Array<T>> {

  protected constructor(private restangularService: Restangular, public kind: String) {
  }

  get(id: string): Observable<T> {
    return this.restangularService.one( id ).get();
  }

  list(): Observable<L> {
    return this.restangularService.getList();
  }

  create(obj: T): Observable<T> {
    return this.restangularService.post( obj );
  }

  update(obj: T): Observable<T> {
    return this.restangularService.one( obj.id ).customPUT(obj);
  }

  delete(obj: T) {
    return this.restangularService.one( obj.id ).remove();
  }

}

{'fraction_non_alphanumeric': 0.1416184971098266, 'fraction_numerical': 0.0011560693641618498, 'mean_word_length': 4.031976744186046, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '2998967', 'n_tokens_mistral': 541, 'n_tokens_neox': 527, 'n_words': 129}