IbrahimNour пре 8 месеци
родитељ
комит
fb7d50acfb

+ 18 - 7
src/app/authentication/auth-sign-up/signup-business/signup-business.component.ts

@@ -101,14 +101,25 @@ export class SignupBusinessComponent
   }
 
   onSubmit(): void {
-    console.log(this.form.value);
-    if (super.submitValidity(this.form)) {
-      const multiPartForm = new FormData();
+    const multiPartForm = new FormData();
+
+    const formData = {
+      ...this.form.value,
+      CompanyUser: {
+        ...this.form.get('companyUser')?.value,
+        userAddress: this.form.get('userAddress')?.value,
+      },
+    };
 
-      for (const key in { ...this.form.value }) {
-        if (this.form.value.hasOwnProperty(key)) {
-          if (this.form.get(key)?.value) {
-            multiPartForm.append(key, this.form.get(key)?.value);
+    delete formData.userAddress;
+    delete formData.companyUser;
+
+    console.log(formData);
+    if (super.submitValidity(this.form)) {
+      for (const key in { ...formData }) {
+        if (formData.hasOwnProperty(key)) {
+          if (formData[key]) {
+            multiPartForm.append(key, formData[key]);
           }
         }
       }