we_bstly-web/src/app/services/voucher.service.ts

21 lines
476 B
TypeScript
Raw Normal View History

2020-11-02 08:29:52 +01:00
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) {
}
2021-10-06 15:24:57 +02:00
get() {
return this.http.get(environment.apiUrl + "/vouchers");
2020-11-02 08:29:52 +01:00
}
2021-10-06 15:24:57 +02:00
create(name: string) {
return this.http.post(environment.apiUrl + "/vouchers/" + name, {});
2020-11-02 08:29:52 +01:00
}
}