export DB, Event creation, broker with city/state

This commit is contained in:
2024-09-12 15:13:56 +02:00
parent 60866473f7
commit 68d2615f0f
21 changed files with 242 additions and 40 deletions

View File

@@ -13,9 +13,9 @@ import { ValidatedInputComponent } from '../../../components/validated-input/val
import { ValidatedNgSelectComponent } from '../../../components/validated-ng-select/validated-ng-select.component';
import { ValidatedTextareaComponent } from '../../../components/validated-textarea/validated-textarea.component';
import { ValidationMessagesService } from '../../../components/validation-messages.service';
import { AuditService } from '../../../services/audit.service';
import { HistoryService } from '../../../services/history.service';
import { ListingsService } from '../../../services/listings.service';
import { LogService } from '../../../services/log.service';
import { MailService } from '../../../services/mail.service';
import { SelectOptionsService } from '../../../services/select-options.service';
import { UserService } from '../../../services/user.service';
@@ -71,7 +71,7 @@ export class DetailsBusinessListingComponent {
public keycloakService: KeycloakService,
private validationMessagesService: ValidationMessagesService,
private messageService: MessageService,
private logService: LogService,
private auditService: AuditService,
public emailService: EMailService,
) {
this.router.events.subscribe(event => {
@@ -89,12 +89,13 @@ export class DetailsBusinessListingComponent {
this.user = await this.userService.getByMail(this.keycloakUser.email);
this.mailinfo = createMailInfo(this.user);
}
this.auditService.createEvent({ listingId: this.listing.id, eventType: 'view', eventTimestamp: new Date(), userAgent: navigator.userAgent, userId: this.user?.email });
try {
this.listing = await lastValueFrom(this.listingsService.getListingById(this.id, 'business'));
this.listingUser = await this.userService.getByMail(this.listing.email);
this.description = this.sanitizer.bypassSecurityTrustHtml(this.listing.description);
} catch (error) {
this.logService.log({ severity: 'error', text: error.error.message });
this.auditService.log({ severity: 'error', text: error.error.message });
this.router.navigate(['notfound']);
}
}