NoelOConnell/quill-image-uploader

How to insert custom attributes (ex:dataset) into img tag?

wywsmail opened this issue · 0 comments

Hi everyone,

I have a question about how to insert custom attributes (ex:dataset) into img tag?

const editorOption = {
      modules: [
        {
          name: "ImageUploader",
          module: ImageUploader,
          options: {
            upload: (file) => {
              return new Promise((resolve, reject) => {
                const formData = new FormData();
                formData.append("file", file);
                formData.append("user_id", "180f891d-2dda-4fa1-8280-35de6cbd0e0b");
                const config: any = {
                  headers: {
                    "Content-Type": "multipart/form-data"
                  }
                };
                axios
                  .post(
                    "https://dev.intelliances.com/broker/medical/v2/gcs/upload",
                    formData,
                    config
                  )
                  .then((res) => {
                    resolve(res.data.data.target_url); 
                  })
                  .catch((err) => {
                    console.log(err);
                  });
              });
            },
          }
        }
      ]
    };