Fix categories loading in side menu component.

This commit is contained in:
Florian THIERRY
2024-08-29 11:09:39 +02:00
parent 5e4068b141
commit d9b856bd43
6 changed files with 75 additions and 37 deletions

View File

@@ -17,8 +17,8 @@ export class CategoryService {
get categories$(): Observable<Category[]> {
if (!this.categories?.length) {
this.categoryRestService.getCategories()
.then(categories => this.categoriesSubject.next(categories))
.catch(error => console.error('An error occured while loading categories.', error));
.then(categories => this.categoriesSubject.next(categories))
.catch(error => console.error('An error occured while loading categories.', error));
}
return this.categoriesSubject.asObservable();
}