Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{success: 0} not working! #251

Open
rahulnikam2002 opened this issue Jun 16, 2024 · 1 comment
Open

{success: 0} not working! #251

rahulnikam2002 opened this issue Jun 16, 2024 · 1 comment
Labels
good first issue Good for newcomers

Comments

@rahulnikam2002
Copy link

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

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
                };
            }
        }
    }
}
@rshkabko
Copy link

Same here. It would be cool to be able to feed an error from the backend so it appears.

@neSpecc neSpecc added the good first issue Good for newcomers label Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants