Hello devs,
I have this form roomForm = new FormGroup({ title: new FormControl(), price: new FormControl(), guestNumber: new FormControl(), details: new FormControl(), hotelId: new FormControl(), image: new FormControl(''), fileSource: new FormControl() }); and can upload upload like this ```onSelect(event: any) {
if (event.target.files.length > 0) {
this.file = event.target.files[0];
}
}
onSubmit() {
this.roomForm.patchValue({hotelId: this.hotelId})
this.roomForm.patchValue({
fileSource: this.file
})
this.apiService.addRoom(this.roomForm.value)
.subscribe((data) =>
console.log(this.roomForm.value)
)
}```
My problem is only the image information is posted to the endpoint and the actual file isn't.