editor-js / link

Link Tool for Editor.js 2.0
MIT License
92 stars 79 forks source link

I want to send url to my backend and get the response just like image tool #90

Closed Abhii5496 closed 7 months ago

Abhii5496 commented 8 months ago

const tool = { image: { class: Image, shortcut: 'CMD+I', config: { uploader: { async uploadByFile(file) { // console.log(file); const fileData = await FiletoBase64(file); // console.log(fileData); const res = await uploadImage({ image: fileData }); if (res.success === 1) { return res; } }, inlineToolbar: true, }, }, linkTool: { class: LinkTool, inlineToolbar: true,

  config: {
   async endpoint(url): await axios.get(`/getMeta/${url_will_be_here_just like_image}`)
  },
},

}, }; ilke this or something