Commit c77fec7c by Muhammad Usman

complete profile fixes

parent f560cd50
...@@ -56,6 +56,6 @@ ...@@ -56,6 +56,6 @@
</div> </div>
<div class="d-flex justify-content-center mt-5"> <div class="d-flex justify-content-center mt-5">
<button class="mc-btn-primary" pButton label="Complete" (click)="completeProfile()"></button> <button class="mc-btn-primary" pButton label="Complete" (click)="saveProfile(true)"></button>
</div> </div>
</div> </div>
...@@ -6,6 +6,7 @@ import { BaseComponent } from '../../../base/base.component'; ...@@ -6,6 +6,7 @@ import { BaseComponent } from '../../../base/base.component';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
import { ToasterService } from '../../../services/toaster.service'; import { ToasterService } from '../../../services/toaster.service';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { CAREER_TABS } from '../../../config/constants';
@Component({ @Component({
selector: 'app-publish', selector: 'app-publish',
...@@ -44,22 +45,23 @@ export class PublishComponent extends BaseComponent implements OnInit { ...@@ -44,22 +45,23 @@ export class PublishComponent extends BaseComponent implements OnInit {
}) })
} }
saveProfile(): void { saveProfile(complete = false): void {
this.isSaving = true; this.isSaving = true;
this.careerProfile.CurrentProfileBuilderTab = CAREER_TABS.PUBLISH;
this.personalDetailsService.saveProfileDefault(this.createdObjs, this.updatedObjs, this.deletedObjs) this.personalDetailsService.saveProfileDefault(this.createdObjs, this.updatedObjs, this.deletedObjs)
.pipe(takeUntil(this.componentInView)) .pipe(takeUntil(this.componentInView))
.subscribe(res => { .subscribe(res => {
this.isSaving = false; this.isSaving = false;
if (complete) {
this.toasterService.success('You have completed you career history, one step closer to done.');
this.router.navigate(['/my-career-web/dashboard/home']);
} else {
this.getCareerProfile(); this.getCareerProfile();
}
}, err => { }, err => {
this.isLoading = false; this.isLoading = false;
this.utilsService.handleError(err); this.utilsService.handleError(err);
}) })
} }
completeProfile(): void {
this.toasterService.success('Profile updated.');
this.router.navigate(['/my-career-web/dashboard/home']);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment