Fixes for #36 and #72

This commit is contained in:
2024-08-14 19:47:19 +02:00
parent a8bb163acf
commit 7f756a71e8
8 changed files with 155 additions and 25 deletions

View File

@@ -71,6 +71,7 @@ export class EditBusinessListingComponent {
quillModules = {
toolbar: [['bold', 'italic', 'underline', 'strike'], [{ list: 'ordered' }, { list: 'bullet' }], [{ header: [1, 2, 3, 4, 5, 6, false] }], [{ color: [] }, { background: [] }], ['clean']],
};
listingUser: User;
constructor(
public selectOptions: SelectOptionsService,
private router: Router,
@@ -102,12 +103,12 @@ export class EditBusinessListingComponent {
async ngOnInit() {
const token = await this.keycloakService.getToken();
const keycloakUser = map2User(token);
this.listingUser = await this.userService.getByMail(keycloakUser.email);
if (this.mode === 'edit') {
this.listing = await lastValueFrom(this.listingsService.getListingById(this.id, 'business'));
} else {
this.listing = createDefaultBusinessListing();
const listingUser = await this.userService.getByMail(keycloakUser.email);
this.listing.email = listingUser.email;
this.listing.email = this.listingUser.email;
this.listing.imageName = emailToDirName(keycloakUser.email);
if (this.data) {
this.listing.title = this.data?.title;