|
|
|
@@ -3,21 +3,24 @@ import {FormGroup} from "@angular/forms"; |
|
|
|
import {contactForm} from "@app/_forms/apiForms"; |
|
|
|
import {ContactJsonld, ContactService} from "@app/core/api/v1"; |
|
|
|
import {Subscription} from "rxjs"; |
|
|
|
import {ModalContent} from "@app/_interfaces/modalContent"; |
|
|
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'app-new-contact', |
|
|
|
templateUrl: './new-contact.component.html', |
|
|
|
styleUrl: './new-contact.component.scss' |
|
|
|
}) |
|
|
|
export class NewContactComponent implements OnInit { |
|
|
|
@Input() contactId: number | undefined; |
|
|
|
export class NewContactComponent implements ModalContent, OnInit { |
|
|
|
|
|
|
|
@Input() public inputData: any; |
|
|
|
|
|
|
|
protected contactForm: FormGroup; |
|
|
|
protected selectedImage: File | null; |
|
|
|
protected contactSub: Subscription; |
|
|
|
|
|
|
|
constructor( |
|
|
|
private contactService: ContactService |
|
|
|
private contactService: ContactService, |
|
|
|
) { |
|
|
|
this.contactForm = contactForm; |
|
|
|
this.selectedImage = null; |
|
|
|
@@ -25,20 +28,20 @@ export class NewContactComponent implements OnInit { |
|
|
|
this.contactSub = new Subscription(); |
|
|
|
} |
|
|
|
|
|
|
|
ngOnInit() { |
|
|
|
console.log(this.contactId); |
|
|
|
} |
|
|
|
|
|
|
|
getData(meineId: any) { |
|
|
|
console.log(meineId); |
|
|
|
ngOnInit(): void { |
|
|
|
console.log(this.inputData); |
|
|
|
} |
|
|
|
|
|
|
|
onSubmit() { |
|
|
|
//console.log(this.partnerId); |
|
|
|
if (this.contactForm.valid) { |
|
|
|
// Hier können Sie die Daten senden oder weitere Aktionen durchführen |
|
|
|
console.log(this.selectedImage); |
|
|
|
console.log('Formular wurde gesendet:', this.contactForm.value); |
|
|
|
|
|
|
|
let newContact: ContactJsonld = this.contactForm.value as ContactJsonld; |
|
|
|
newContact.postings = []; |
|
|
|
|
|
|
|
this.contactSub = this.contactService.contactsPost( |
|
|
|
this.contactForm.value as ContactJsonld |
|
|
|
).subscribe( |
|
|
|
|