diverse BugFixes
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user