we_bstly-web/src/app/services/voucher.service.ts
2021-10-06 15:24:57 +02:00

21 lines
476 B
TypeScript

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, {});
}
}