refactor: rename components and update admin navbar; implement generic list and dialog components for brands, categories, and platforms
This commit is contained in:
@@ -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: () => {
|
||||
|
||||
Reference in New Issue
Block a user