diff --git a/s3file/static/s3file/js/s3file.js b/s3file/static/s3file/js/s3file.js index a54917c..3e3b6dc 100644 --- a/s3file/static/s3file/js/s3file.js +++ b/s3file/static/s3file/js/s3file.js @@ -217,15 +217,15 @@ export class S3FileInput extends globalThis.HTMLElement { async submitHandler(event) { event.preventDefault() this.form?.dispatchEvent(new window.CustomEvent("upload")) - await Promise.all(this.form?.pendingRquests) + await Promise.all(this.form?.pendingRequests) this.form?.requestSubmit(event.submitter) } uploadHandler() { if (this.files.length && !this.upload) { this.upload = this.uploadFiles() - this.form.pendingRquests = this.form?.pendingRquests || [] - this.form.pendingRquests.push(this.upload) + this.form.pendingRequests = this.form?.pendingRequests || [] + this.form.pendingRequests.push(this.upload) } } diff --git a/tests/__tests__/s3file.test.js b/tests/__tests__/s3file.test.js index d63d794..d94513e 100644 --- a/tests/__tests__/s3file.test.js +++ b/tests/__tests__/s3file.test.js @@ -55,7 +55,7 @@ describe("S3FileInput", () => { test("submitHandler", async () => { const form = document.createElement("form") document.body.appendChild(form) - form.pendingRquests = [] + form.pendingRequests = [] form.requestSubmit = mock.fn(form.requestSubmit) form.dispatchEvent = mock.fn(form.dispatchEvent) const submitButton = document.createElement("button") @@ -82,7 +82,7 @@ describe("S3FileInput", () => { input.uploadHandler() console.log(input.upload) assert(input.upload) - assert(form.pendingRquests) + assert(form.pendingRequests) }) test("fromDataHandler", () => {