source: bus-n-go-pavel-216049/bus-n-go-frontend/src/app/services/fine/fine.service.ts

Last change on this file was baf4cc4, checked in by ppaunovski <paunovskipavel@…>, 3 months ago

split group project and individual project into two separate folders

  • Property mode set to 100644
File size: 633 bytes
RevLine 
[baf4cc4]1import { Injectable } from '@angular/core';
2import {Observable} from "rxjs";
3import {FineResponse} from "../../model/responses/FineResponse";
4import {FineRequest} from "../../model/requests/FineRequest";
5import {HttpClient, HttpHeaders} from "@angular/common/http";
6
7@Injectable({
8 providedIn: 'root'
9})
10export class FineService {
11 private url = '/api/fines'
12
13 constructor(private http: HttpClient) { }
14
15 createFine(request: FineRequest): Observable<FineResponse> {
16 return this.http.put<FineResponse>(`${this.url}`, JSON.stringify(request), {
17 headers: new HttpHeaders({'Content-Type': 'application/json'})
18 })
19 }
20}
Note: See TracBrowser for help on using the repository browser.