[IMP] web: update upload service docstring

As the upload service (js) only uses iteration, index based access and length
on the files parameter, it is compatible as well with an array of File as files
parameter (instead of a FileList). So, we have updated the files parameter
docstring to accept as well array of File. With this change we can easily pass
a modified list of files (ListFile being hard to create on some browser).
Example of use-case, only send to the upload service the files smaller than a
given threshold by transforming a FileList to an array and then by filtering
it.

Task-3179130

closes odoo/odoo#117385

Related: odoo/enterprise#38490
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
This commit is contained in:
Pierre-Yves Dufays
2023-04-04 11:02:08 +02:00
parent 23cf931808
commit 059dc88d17
@@ -24,7 +24,7 @@ export const fileUploadService = {
/**
* @param {string} route
* @param {FileList} files
* @param {FileList|Array<File>} files
* @param {Object} [params]
* @param {function(formData): void} [params.buildFormData]
* @param {Boolean} [params.displayErrorNotification]