diverse BugFixes

This commit is contained in:
2024-08-12 17:18:32 +02:00
parent 3a6a64cce9
commit ec0576e7b8
17 changed files with 118 additions and 100 deletions

View File

@@ -128,12 +128,18 @@ export class AccountComponent {
async updateProfile(user: User) {
if (this.user.customerType === 'buyer') {
const id = this.user.id;
this.user = createDefaultUser(this.user.email, this.user.firstname, this.user.lastname);
this.user.customerType = 'buyer';
this.user.id = id;
this.imageService.deleteLogoImagesByMail(this.user.email);
this.imageService.deleteProfileImagesByMail(this.user.email);
const confirmed = await this.confirmationService.showConfirmation({ message: 'Are you sure you want to switch to Buyer ? All your listings as well as all your professionals informations will be deleted' });
if (confirmed) {
const id = this.user.id;
this.user = createDefaultUser(this.user.email, this.user.firstname, this.user.lastname);
this.user.customerType = 'buyer';
this.user.id = id;
this.imageService.deleteLogoImagesByMail(this.user.email);
this.imageService.deleteProfileImagesByMail(this.user.email);
} else {
this.user.customerType = 'professional';
return;
}
}
try {
await this.userService.save(this.user);