Last change
on this file since dedbf60 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
|
Rev | Line | |
---|
[baf4cc4] | 1 | import { Injectable } from '@angular/core';
|
---|
| 2 | import {Observable} from "rxjs";
|
---|
| 3 | import {FineResponse} from "../../model/responses/FineResponse";
|
---|
| 4 | import {FineRequest} from "../../model/requests/FineRequest";
|
---|
| 5 | import {HttpClient, HttpHeaders} from "@angular/common/http";
|
---|
| 6 |
|
---|
| 7 | @Injectable({
|
---|
| 8 | providedIn: 'root'
|
---|
| 9 | })
|
---|
| 10 | export 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.