Advertisement
psi_mmobile

Untitled

Oct 26th, 2022
1,109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.           const infoQualificationForm = this.qualificationFormComponent.get();
  2.           const updatedQualification = this.adminComponent.selectedQualification.data;
  3.           Object.assign(updatedQualification, infoQualificationForm);
  4.           this.adminService.updateQualification(updatedQualification).subscribe(_  => {
  5.             if (updatedQualification.parent_qualification_id === null) {
  6.               Object.assign(this.adminComponent.qualifications.find(qualification => qualification.qualification_id === updatedQualification.qualification_id), updatedQualification);
  7.             } else {
  8.               const parentQualification = this.adminComponent.qualifications.find(qualification => qualification.qualification_id === updatedQualification.parent_qualification_id);
  9.               Object.assign(parentQualification.children.find(qualification => qualification.qualification_id === updatedQualification.qualification_id), updatedQualification);
  10.             }
  11.             // Object.assign(this.adminComponent.selectedQualification,updatedQualification);
  12.             this.adminComponent.selectedQualification.data = updatedQualification;
  13.             this.finishRequest(resolve);
  14.           }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement