|
|
|
@@ -1,7 +1,7 @@ |
|
|
|
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; |
|
|
|
import {FormGroup} from "@angular/forms"; |
|
|
|
import {contactForm} from "@app/_forms/apiForms"; |
|
|
|
import {ContactJsonld, ContactService} from "@app/core/api/v1"; |
|
|
|
import {ContactJsonld, ContactService, PartnerJsonld} from "@app/core/api/v1"; |
|
|
|
import {Subscription} from "rxjs"; |
|
|
|
import {ModalContent} from "@app/_interfaces/modalContent"; |
|
|
|
|
|
|
|
@@ -13,7 +13,7 @@ import {ModalContent} from "@app/_interfaces/modalContent"; |
|
|
|
}) |
|
|
|
export class NewContactComponent implements ModalContent, OnInit { |
|
|
|
|
|
|
|
@Input() public inputData: any; |
|
|
|
@Input() public partner!: PartnerJsonld; |
|
|
|
@Output() public submit: EventEmitter<any> = new EventEmitter<any>(); |
|
|
|
|
|
|
|
protected contactForm: FormGroup; |
|
|
|
@@ -30,12 +30,11 @@ export class NewContactComponent implements ModalContent, OnInit { |
|
|
|
} |
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
console.log(this.inputData); |
|
|
|
this.contactForm.patchValue({"partner": this.inputData}); |
|
|
|
console.log(this.partner.id); |
|
|
|
this.contactForm.patchValue({"partner": this.partner}); |
|
|
|
} |
|
|
|
|
|
|
|
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); |
|
|
|
@@ -44,16 +43,16 @@ export class NewContactComponent implements ModalContent, OnInit { |
|
|
|
let newContact: ContactJsonld = this.contactForm.value as ContactJsonld; |
|
|
|
newContact.posts = []; |
|
|
|
|
|
|
|
this.submit.emit("HALLO DANIEL"); |
|
|
|
// this.submit.emit("HALLO DANIEL"); |
|
|
|
|
|
|
|
// this.contactSub = this.contactService.contactsPost( |
|
|
|
// this.contactForm.value as ContactJsonld |
|
|
|
// ).subscribe( |
|
|
|
// data => { |
|
|
|
// console.log(data); |
|
|
|
// this.submit.emit("HALLO DANIEL"); |
|
|
|
// } |
|
|
|
// ); |
|
|
|
this.contactSub = this.contactService.contactsPost( |
|
|
|
this.contactForm.value as ContactJsonld |
|
|
|
).subscribe( |
|
|
|
data => { |
|
|
|
console.log(data); |
|
|
|
this.submit.emit("HALLO DANIEL"); |
|
|
|
} |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|