I have method to save image. Initial this.educationalData
gives back data in console.log but after that when i try to get id
from endpoint. It gives me undefined.
UPDATED
it is now sending id of 1 but still respond of 404
saveImage() {
const file = this.imageChangedEvent;
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () = >{
this.apiService.postData('educational-award/' + this.educationalData[0].id, {
"photo": reader.result,
"id": this.educationalData[0].id
}).subscribe(data = >{
console.log('test')
});
};
}
UPDATE (latest)
I found out i was using the wrong endpoint. Im sorry for causing trouble to everyone.
Route::post('/upload-picture', [UserController::class, 'uploadPicture']);
Screenshot to give more clarity
UPDATED