|
@@ -145,59 +145,22 @@ export class SignupEmployeeComponent
|
|
}
|
|
}
|
|
|
|
|
|
onSubmit(): void {
|
|
onSubmit(): void {
|
|
- this.multiPartForm.append('firstName', this.form.get('firstName')?.value);
|
|
|
|
- this.multiPartForm.append('lastName', this.form.get('lastName')?.value);
|
|
|
|
- this.multiPartForm.append(
|
|
|
|
- 'dateOfBirth',
|
|
|
|
- this.form.get('dateOfBirth')?.value
|
|
|
|
- );
|
|
|
|
- this.multiPartForm.append('email', this.form.get('email')?.value);
|
|
|
|
- this.multiPartForm.append('idNumber', this.form.get('idNumber')?.value);
|
|
|
|
- this.multiPartForm.append(
|
|
|
|
- 'phoneNumber',
|
|
|
|
- this.form.get('phoneNumber')?.value
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- this.multiPartForm.append('userType', this.form.get('userType')?.value);
|
|
|
|
- this.multiPartForm.append(
|
|
|
|
- 'favoriteName',
|
|
|
|
- this.form.get('favoriteName')?.value
|
|
|
|
- );
|
|
|
|
- this.multiPartForm.append(
|
|
|
|
- 'passportNumber',
|
|
|
|
- this.form.get('passportNumber')?.value
|
|
|
|
- );
|
|
|
|
- this.multiPartForm.append(
|
|
|
|
- 'qualificationId',
|
|
|
|
- this.form.get('qualificationId')?.value
|
|
|
|
- );
|
|
|
|
- this.multiPartForm.append(
|
|
|
|
- 'universityId',
|
|
|
|
- this.form.get('universityId')?.value
|
|
|
|
- );
|
|
|
|
- this.multiPartForm.append('jobTitleId', this.form.get('jobTitleId')?.value);
|
|
|
|
- this.multiPartForm.append('industryId', this.form.get('industryId')?.value);
|
|
|
|
- this.multiPartForm.append('taxNumber', this.form.get('taxNumber')?.value);
|
|
|
|
- this.multiPartForm.append(
|
|
|
|
- 'incomeTaxValue',
|
|
|
|
- this.form.get('incomeTaxValue')?.value
|
|
|
|
- );
|
|
|
|
- this.multiPartForm.append('userName', this.form.get('userName')?.value);
|
|
|
|
- this.multiPartForm.append('password', this.form.get('password')?.value);
|
|
|
|
- this.multiPartForm.append(
|
|
|
|
- 'linkedInLink',
|
|
|
|
- this.form.get('linkedInLink')?.value
|
|
|
|
- );
|
|
|
|
|
|
+ console.log(this.form.get('userName')?.value);
|
|
|
|
+ for (const key in this.form.value) {
|
|
|
|
+ if (this.form.value.hasOwnProperty(key)) {
|
|
|
|
+ this.multiPartForm.append(key, this.form.value[key]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
- this.multiPartForm.append(
|
|
|
|
- 'userAddress',
|
|
|
|
- JSON.stringify({
|
|
|
|
- countryId: this.form.get('countryId')?.value,
|
|
|
|
- cityId: 1,
|
|
|
|
- postalCode: this.form.get('postalCode')?.value,
|
|
|
|
- addressDesc: this.form.get('addressDesc')?.value,
|
|
|
|
- })
|
|
|
|
- );
|
|
|
|
|
|
+ // this.multiPartForm.append(
|
|
|
|
+ // 'userAddress',
|
|
|
|
+ // JSON.stringify({
|
|
|
|
+ // countryId: this.form.get('countryId')?.value,
|
|
|
|
+ // cityId: 1,
|
|
|
|
+ // postalCode: this.form.get('postalCode')?.value,
|
|
|
|
+ // addressDesc: this.form.get('addressDesc')?.value,
|
|
|
|
+ // })
|
|
|
|
+ // );
|
|
|
|
|
|
this.authService
|
|
this.authService
|
|
.addEmployee(this.multiPartForm)
|
|
.addEmployee(this.multiPartForm)
|