Issues gitea

This commit is contained in:
2026-01-15 21:26:07 +01:00
parent 897ab1ff77
commit 09e7ce59a9
18 changed files with 496 additions and 124 deletions

View File

@@ -174,6 +174,9 @@ export class BrokerListingsComponent implements OnInit, OnDestroy {
}
try {
console.log('Toggling favorite for:', professional.email, 'Current user:', this.currentUser.email);
console.log('Before update, favorites:', professional.favoritesForUser);
if (this.isFavorite(professional)) {
// Remove from favorites
await this.listingsService.removeFavorite(professional.id, 'user');
@@ -186,8 +189,12 @@ export class BrokerListingsComponent implements OnInit, OnDestroy {
if (!professional.favoritesForUser) {
professional.favoritesForUser = [];
}
professional.favoritesForUser.push(this.currentUser.email);
// Use spread to create new array reference
professional.favoritesForUser = [...professional.favoritesForUser, this.currentUser.email];
}
console.log('After update, favorites:', professional.favoritesForUser);
this.cdRef.markForCheck();
this.cdRef.detectChanges();
} catch (error) {
console.error('Error toggling favorite:', error);