refactor: rename components and update admin navbar; implement generic list and dialog components for brands, categories, and platforms

This commit is contained in:
Vincent Guillet
2025-11-01 17:56:26 +01:00
parent e7da8b9b83
commit 55a1d54c70
42 changed files with 932 additions and 1148 deletions

View File

@@ -178,12 +178,12 @@ export class AddProductComponent implements OnInit, OnDestroy {
ngOnInit(): void {
this.brandSubscription = this.brandService.getBrands().subscribe({
this.brandSubscription = this.brandService.getAll().subscribe({
next: (brands: Brand[]) => {
this.brands = this.normalizeIds(brands, 'id');
this.filteredBrands = [...this.brands];
},
error: (error) => {
error: (error: any) => {
console.error('Error fetching brands:', error);
},
complete: () => {
@@ -191,12 +191,12 @@ export class AddProductComponent implements OnInit, OnDestroy {
}
});
this.platformSubscription = this.platformService.getPlatforms().subscribe({
this.platformSubscription = this.platformService.getAll().subscribe({
next: (platforms: Platform[]) => {
this.platforms = this.normalizeIds(platforms, 'id');
this.filteredPlatforms = [...this.platforms];
},
error: (error) => {
error: (error: any) => {
console.error('Error fetching platforms:', error);
},
complete: () => {
@@ -204,11 +204,11 @@ export class AddProductComponent implements OnInit, OnDestroy {
}
});
this.categorySubscription = this.categoryService.getCategories().subscribe({
this.categorySubscription = this.categoryService.getAll().subscribe({
next: (categories: Category[]) => {
this.categories = this.normalizeIds(categories, 'id');
},
error: (error) => {
error: (error: any) => {
console.error('Error fetching categories:', error);
},
complete: () => {