Commit ac4ddec0 by Muhammad Usman

career builder changes

parent ad2fa1f5
...@@ -85,6 +85,11 @@ export class EducationComponent extends BaseComponent implements OnInit { ...@@ -85,6 +85,11 @@ export class EducationComponent extends BaseComponent implements OnInit {
if (this.form.invalid) { if (this.form.invalid) {
return this.helperService.validateAllFormFields(this.form); return this.helperService.validateAllFormFields(this.form);
} }
if (!this.careerProfile.NoEducationQualification) {
while (this.careerProfile.EducationCertificates.length > 0) {
this.utilsService.removeMultiRefObject(this.careerProfile.EducationCertificates[0], this.careerProfile, 'EducationCertificates', this.createdObjs, this.updatedObjs, this.deletedObjs);
}
}
this.careerProfile.EducationCertificates.forEach(exp => { this.careerProfile.EducationCertificates.forEach(exp => {
if (typeof exp.Certification === 'string') { if (typeof exp.Certification === 'string') {
const certificate = new CertificationModel(); const certificate = new CertificationModel();
......
...@@ -33,6 +33,7 @@ export class PublishComponent extends BaseComponent implements OnInit { ...@@ -33,6 +33,7 @@ export class PublishComponent extends BaseComponent implements OnInit {
.subscribe(response => { .subscribe(response => {
this.isLoading = false; this.isLoading = false;
this.careerProfile = response; this.careerProfile = response;
console.log(this.careerProfile);
this.updatedObjs[this.careerProfile.ObjectID] = this.careerProfile; this.updatedObjs[this.careerProfile.ObjectID] = this.careerProfile;
}, err => { }, err => {
this.isLoading = false; this.isLoading = false;
...@@ -46,6 +47,7 @@ export class PublishComponent extends BaseComponent implements OnInit { ...@@ -46,6 +47,7 @@ export class PublishComponent extends BaseComponent implements OnInit {
.pipe(takeUntil(this.componentInView)) .pipe(takeUntil(this.componentInView))
.subscribe(res => { .subscribe(res => {
this.isSaving = false; this.isSaving = false;
this.getCareerProfile();
}, err => { }, err => {
this.isLoading = false; this.isLoading = false;
this.utilsService.handleError(err); this.utilsService.handleError(err);
......
...@@ -87,6 +87,11 @@ export class ReferencesComponent extends BaseComponent implements OnInit { ...@@ -87,6 +87,11 @@ export class ReferencesComponent extends BaseComponent implements OnInit {
if (this.form.invalid) { if (this.form.invalid) {
return this.helperService.validateAllFormFields(this.form); return this.helperService.validateAllFormFields(this.form);
} }
if (!this.careerProfile.NoReference) {
while (this.careerProfile.Referees.length > 0) {
this.utilsService.removeMultiRefObject(this.careerProfile.Referees[0], this.careerProfile, 'Referees', this.createdObjs, this.updatedObjs, this.deletedObjs);
}
}
this.isSaving = true; this.isSaving = true;
this.personalDetailsService.saveProfile(this.createdObjs, this.updatedObjs, this.deletedObjs) this.personalDetailsService.saveProfile(this.createdObjs, this.updatedObjs, this.deletedObjs)
.pipe(takeUntil(this.componentInView)) .pipe(takeUntil(this.componentInView))
......
...@@ -94,6 +94,11 @@ export class WorkHistoryComponent extends BaseComponent implements OnInit { ...@@ -94,6 +94,11 @@ export class WorkHistoryComponent extends BaseComponent implements OnInit {
if (this.form.invalid) { if (this.form.invalid) {
return this.helperService.validateAllFormFields(this.form); return this.helperService.validateAllFormFields(this.form);
} }
if (!this.careerProfile.NoWorkExperience) {
while (this.careerProfile.WorkExperiences.length > 0) {
this.utilsService.removeMultiRefObject(this.careerProfile.WorkExperiences[0], this.careerProfile, 'WorkExperiences', this.createdObjs, this.updatedObjs, this.deletedObjs);
}
}
this.careerProfile.WorkExperiences.forEach(exp => { this.careerProfile.WorkExperiences.forEach(exp => {
exp.StartMonth = UtilsService.convertDateToString(exp.StartMonthField); exp.StartMonth = UtilsService.convertDateToString(exp.StartMonthField);
exp.EndMonth = UtilsService.convertDateToString(exp.EndMonthField); exp.EndMonth = UtilsService.convertDateToString(exp.EndMonthField);
......
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