20 lines
502 B
TypeScript
20 lines
502 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { HttpService } from './http.service';
|
|
|
|
@Injectable({
|
|
providedIn: 'root',
|
|
})
|
|
export class MerchantService {
|
|
public static readonly MERCHANT_PATH = 'http://localhost:3000/common-cents/merchants';
|
|
|
|
public constructor(private readonly http: HttpService) { }
|
|
|
|
public async getMerchants(): Promise<Merchant[]> {
|
|
return this.http.get<Merchant[]>(MerchantService.MERCHANT_PATH);
|
|
}
|
|
}
|
|
|
|
export interface Merchant {
|
|
id: string;
|
|
name: string;
|
|
}
|