import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { environment } from '../../environments/environment'; @Injectable({ providedIn: 'root', }) export class VoucherService { constructor(private http: HttpClient) { } get() { return this.http.get(environment.apiUrl + "/vouchers"); } create(name: string) { return this.http.post(environment.apiUrl + "/vouchers/" + name, {}); } }