My domain layer requires an entity to have 1:N images associated with it.
As FineUploader sends each image as a separate request, i am creating an entity (server side) on the first request and sending the ID of that back in the first response JSON to be added to the subsequent requests, so that the remaining images have an entity relationship ID to be saved with. This is all working well, except the new ID returned from the first request is not being appended to the next request.
I am using setParams to append the ID by hooking onto the onComplete event, as follows:
var uploader = new qq.FineUploader({
debug: true,
element: document.getElementById('fine-uploader'),
allowedExtensions: ['jpg', 'jpeg', 'bmp', 'png','gif'],
callbacks : {
onComplete : function(id, name, responseJSON){
this.setParams({entityId: responseJSON.entityId});
}
}
});
The new param is not added to request URI or post data. What am i doing wrong?
(Using FineUploader 5.15.3, debugged on FireFox Developer Edition, PHP 7.1 server side)