From ed1caac03f7b985c340a908137cbf6407399b9f1 Mon Sep 17 00:00:00 2001 From: NasaHack Date: Mon, 27 Jan 2025 19:17:10 +0600 Subject: [PATCH] fix: correct syntax errors and undefined variables in README example Removed an extra comma causing syntax issues in the uploadByUrl method. Replaced the undefined 'file' with 'url'. Ensured code consistency for MyAjax.upload usage. --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 39e29a2..25c0b82 100644 --- a/README.md +++ b/README.md @@ -257,7 +257,7 @@ var editor = EditorJS({ * @param {File} file - file selected from the device or pasted by drag-n-drop * @return {Promise.<{success, file: {url}}>} */ - uploadByFile(file){ + uploadByFile(file) { // your own uploading logic here return MyAjax.upload(file).then(() => { return { @@ -275,17 +275,17 @@ var editor = EditorJS({ * @param {string} url - pasted image URL * @return {Promise.<{success, file: {url}}>} */ - uploadByUrl(url){ + uploadByUrl(url) { // your ajax request for uploading - return MyAjax.upload(file).then(() => { + return MyAjax.upload(url).then(() => { return { success: 1, file: { - url: 'https://codex.so/upload/redactor_images/o_e48549d1855c7fc1807308dd14990126.jpg',, + url: 'https://codex.so/upload/redactor_images/o_e48549d1855c7fc1807308dd14990126.jpg', // any other image data you want to store, such as width, height, color, extension, etc } - } - }) + }; + }); } } }