added create category support

This commit is contained in:
Joe Arndt 2026-02-26 12:10:55 -06:00
parent a8548ce2f4
commit 248ded53c0
5 changed files with 11 additions and 10 deletions

View file

@ -18,7 +18,8 @@ export class CategoriesComponent {
public constructor(private readonly categoryService: CategoryService) { }
public async createCategory(name: string): Promise<void> {
console.log('Creating new category', name);
await this.categoryService.createCategory({ name });
await this.categoryService.fetchCategories();
}
public async updateCategory(category: Category): Promise<void> {

View file

@ -15,11 +15,9 @@
</mat-form-field>
<div class="metadata-edit-buttons">
@if (metadata()) {
<button matIconButton (click)="reset()">
<mat-icon>undo</mat-icon>
</button>
}
<button matIconButton (click)="reset()">
<mat-icon>undo</mat-icon>
</button>
<button matIconButton (click)="saveMetaData()" [disabled]="!nameValid()">
<mat-icon>save</mat-icon>