scaffold expense list
This commit is contained in:
parent
7bb21f8796
commit
fded7f7c09
22 changed files with 253 additions and 133 deletions
20
src/app/services/category.service.ts
Normal file
20
src/app/services/category.service.ts
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { HttpService } from './http.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class CategoryService {
|
||||
public static readonly CATEGORY_PATH = 'http://localhost:3000/common-cents/categories';
|
||||
|
||||
public constructor(private readonly http: HttpService) { }
|
||||
|
||||
public async getCategories(): Promise<Category[]> {
|
||||
return this.http.get<Category[]>(CategoryService.CATEGORY_PATH);
|
||||
}
|
||||
}
|
||||
|
||||
export interface Category {
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue