added create category support
This commit is contained in:
parent
a8548ce2f4
commit
248ded53c0
5 changed files with 11 additions and 10 deletions
|
|
@ -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> {
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue