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

@@ -379,13 +379,27 @@ export class DetailsBusinessListingComponent extends BaseDetailsComponent {
}
return result;
}
async save() {
await this.listingsService.addToFavorites(this.listing.id, 'business');
this.listing.favoritesForUser.push(this.user.email);
this.auditService.createEvent(this.listing.id, 'favorite', this.user?.email);
}
isAlreadyFavorite() {
return this.listing.favoritesForUser.includes(this.user.email);
async toggleFavorite() {
try {
const isFavorited = this.listing.favoritesForUser.includes(this.user.email);
if (isFavorited) {
// Remove from favorites
await this.listingsService.removeFavorite(this.listing.id, 'business');
this.listing.favoritesForUser = this.listing.favoritesForUser.filter(
email => email !== this.user.email
);
} else {
// Add to favorites
await this.listingsService.addToFavorites(this.listing.id, 'business');
this.listing.favoritesForUser.push(this.user.email);
this.auditService.createEvent(this.listing.id, 'favorite', this.user?.email);
}
this.cdref.detectChanges();
} catch (error) {
console.error('Error toggling favorite:', error);
}
}
async showShareByEMail() {
const result = await this.emailService.showShareByEMail({