editor-js / editor-js/image

{success: 0} not working!

Open
#251 1 comment 2 reactions 0 assignees View on GitHub
good first issue
Dominant language
TypeScript
Stars
285
Forks
307
PR merge metrics
No merged PRs in 30d

Description

If there's error, still the loading is showing!!

### Console Message
Image Tool: uploading failed because of incorrect response: {success: 0}

![Screenshot 2024-06-16 204336](https://github.com/editor-js/image/assets/79020081/88851ad6-7f82-4ac7-9b4d-4268380ed243)

success: 0 is not working ig!!

My code:

image: {
class: editorPlugins.ImageTool.class,
config: {
uploader: {
async uploadByFile(file) {
const url = await uploadFile(file);

if (url.uploaded) {
alert("hello");
toast.success("Image uploaded successfully!");
return { success: 1, file: { url: url.data.secure_url, data: url.data } };
}
toast.error("Failed to upload image!");
return {
success: 0
};
}
}
}
}

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.