diff --git a/src/app/services/works.service.ts b/src/app/services/works.service.ts deleted file mode 100644 index f7d1d1a..0000000 --- a/src/app/services/works.service.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Work } from '../models/work.model'; -import { HttpClient } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { NgForm } from '@angular/forms'; - -@Injectable({ - providedIn: 'root', -}) -export class WorksService { - API_URL = 'http://127.0.0.1:3000'; - - private works: Work[] = []; - - constructor(private http: HttpClient) {} - - getWorks(): Observable { - return this.http.get(`${this.API_URL}/works`); - } - - postWork(form: NgForm): void { - let body = { - link: form.value.link, - id_user: 1, - id_language: 1, - code: form.value.content, - }; - this.http.post(`${this.API_URL}/works`, body).subscribe(); - } - - postWorkCode(code: string): void { - let body = { link: 'TODO', id_user: 1, id_language: 1, code: code }; - this.http.post(`${this.API_URL}/works`, body).subscribe(); - } -}