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

Problem with callback when image deleted #2

Closed
applecat opened this issue Apr 3, 2014 · 2 comments
Closed

Problem with callback when image deleted #2

applecat opened this issue Apr 3, 2014 · 2 comments

Comments

@applecat
Copy link

applecat commented Apr 3, 2014

In my code I try to delete image from cloudinary this way:

Meteor.call("cloudinary_delete", image.public_id);

Image successfully deletes, but in console I see:

/Users/dimus/.meteorite/packages/cloudinary/Lepozepo/cloudinary/037bd59917c2d59a22761e64b5d4cf0cfe58c519/.build/npm/node_modules/cloudinary/lib/api.coffee:298
          return callback(result);
                 ^
TypeError: undefined is not a function
    at IncomingMessage.<anonymous> (/Users/dimus/.meteorite/packages/cloudinary/Lepozepo/cloudinary/037bd59917c2d59a22761e64b5d4cf0cfe58c519/.build/npm/node_modules/cloudinary/lib/api.coffee:298:18)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:920:16
    at process._tickCallback (node.js:415:13)

I think problem is somewhere out here:

server.js

    cloudinary_delete:function(public_id){
        //This isn't very safe, lol
        this.unblock();
        Cloudinary.api.delete_resources([public_id]);
    },

api.coffee

exports.delete_resources = (public_ids, callback, options={}) ->
  resource_type = options["resource_type"] ? "image"
  type = options["type"] ? "upload"    
  uri = ["resources", resource_type, type]
  call_api("delete", uri, _.extend({"public_ids[]": public_ids}, only(options, "keep_original")), callback, options)      

There is not callback set in Cloudinary.api.delete_resources call.

Can you comment on that?

@Lepozepo
Copy link
Owner

Lepozepo commented Apr 3, 2014

I'll check up on it as soon as I can ^_^

@Lepozepo
Copy link
Owner

Lepozepo commented Apr 4, 2014

520dfae should fix this. Let me know if you have any other issues with it though. ^_^

@Lepozepo Lepozepo closed this as completed Apr 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants