From 9c1ee77a207124d3fcdfd2e86e092501240cfff4 Mon Sep 17 00:00:00 2001 From: pk Date: Fri, 17 Jan 2025 11:08:15 +0100 Subject: [PATCH] Files should be an empty array by default --- package.json | 2 +- upload-files.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 24ef5ea..42fc3af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tp/helpers", - "version": "2.3.1", + "version": "2.3.2", "description": "", "main": "closest.js", "scripts": { diff --git a/upload-files.js b/upload-files.js index 6004583..1f1284c 100644 --- a/upload-files.js +++ b/upload-files.js @@ -8,7 +8,7 @@ export const upload = function(superClass) { * @param {Object} opts Upload options * @returns Promise */ - uploadFiles(url, files, data = {}) { + uploadFiles(url, files = [], data = {}) { return new Promise((resolve, reject) => { const request = new XMLHttpRequest(); const formData = new FormData();