diff --git a/bizmatch/src/app/pages/login/login.component.ts b/bizmatch/src/app/pages/login/login.component.ts index ed95290..1e33e51 100644 --- a/bizmatch/src/app/pages/login/login.component.ts +++ b/bizmatch/src/app/pages/login/login.component.ts @@ -27,7 +27,7 @@ export class LoginComponent { const activeSubscription = subscriptions.filter(s => s.status === 'active'); if (activeSubscription.length > 0) { user.subscriptionPlan = activeSubscription[0].metadata['plan'] === 'Broker Plan' ? 'broker' : 'professional'; - this.userService.save(user); + this.userService.saveGuaranteed(user); } else { this.router.navigate([`/pricing`]); return; diff --git a/bizmatch/src/app/pages/pricing/pricing.component.ts b/bizmatch/src/app/pages/pricing/pricing.component.ts index 6e7b75d..d651edb 100644 --- a/bizmatch/src/app/pages/pricing/pricing.component.ts +++ b/bizmatch/src/app/pages/pricing/pricing.component.ts @@ -32,7 +32,7 @@ export class PricingComponent { if (this.id === 'free') { this.user = await this.userService.getByMail(this.keycloakUser.email); this.user.subscriptionPlan = 'free'; - await this.userService.save(this.user); + await this.userService.saveGuaranteed(this.user); this.router.navigate([`/account`]); } else if (this.id) { this.checkout({ priceId: atob(this.id), email: this.keycloakUser.email, name: `${this.keycloakUser.firstName} ${this.keycloakUser.lastName}` }); @@ -50,7 +50,7 @@ export class PricingComponent { if (!priceId) { this.user = await this.userService.getByMail(this.keycloakUser.email); this.user.subscriptionPlan = 'free'; - await this.userService.save(this.user); + await this.userService.saveGuaranteed(this.user); this.router.navigate([`/account`]); } else { this.checkout({ priceId: priceId, email: this.keycloakUser.email, name: `${this.keycloakUser.firstName} ${this.keycloakUser.lastName}` }); diff --git a/bizmatch/src/app/pages/subscription/account/account.component.ts b/bizmatch/src/app/pages/subscription/account/account.component.ts index 1b0b564..dc4285c 100644 --- a/bizmatch/src/app/pages/subscription/account/account.component.ts +++ b/bizmatch/src/app/pages/subscription/account/account.component.ts @@ -232,7 +232,7 @@ export class AccountComponent { this.profileUrl = `${this.env.imageBaseUrl}/pictures/profile/${emailToDirName(this.user.email)}.avif?_ts=${new Date().getTime()}`; this.sharedService.changeProfilePhoto(this.profileUrl); } - await this.userService.save(this.user); + await this.userService.saveGuaranteed(this.user); } } async deleteConfirm(type: 'profile' | 'logo') { @@ -240,10 +240,10 @@ export class AccountComponent { if (confirmed) { if (type === 'profile') { this.user.hasProfile = false; - await Promise.all([this.imageService.deleteProfileImagesByMail(this.user.email), this.userService.save(this.user)]); + await Promise.all([this.imageService.deleteProfileImagesByMail(this.user.email), this.userService.saveGuaranteed(this.user)]); } else { this.user.hasCompanyLogo = false; - await Promise.all([this.imageService.deleteLogoImagesByMail(this.user.email), this.userService.save(this.user)]); + await Promise.all([this.imageService.deleteLogoImagesByMail(this.user.email), this.userService.saveGuaranteed(this.user)]); } this.user = await this.userService.getById(this.user.id); // this.messageService.showMessage('Image deleted');