Skip to content

Commit 572a6b4

Browse files
author
Amir Tocker
committed
Support listing of named transformations using the named parameter
1 parent 4d113a2 commit 572a6b4

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

lib-es5/api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ exports.tags = function tags(callback) {
387387
exports.transformations = function transformations(callback) {
388388
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
389389

390-
return call_api("get", ["transformations"], only(options, "next_cursor", "max_results"), callback, options);
390+
return call_api("get", ["transformations"], only(options, "next_cursor", "max_results", "named"), callback, options);
391391
};
392392

393393
exports.transformation = function transformation(transformation, callback) {

lib/api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ exports.tags = function tags(callback, options={}) {
292292
};
293293

294294
exports.transformations = function transformations(callback, options={}) {
295-
return call_api("get", ["transformations"], only(options, "next_cursor", "max_results"), callback, options);
295+
return call_api("get", ["transformations"], only(options, "next_cursor", "max_results", "named"), callback, options);
296296
};
297297

298298
exports.transformation = function transformation(transformation, callback, options={}) {

test/api_spec.coffee

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,14 @@ describe "api", ->
409409
expect(transformation.info).to.eql([crop: "scale", width: 102])
410410
expect(transformation.used).not.to.be.ok()
411411

412+
it "should allow listing of named transformations", ()->
413+
helper.mockPromise (xhr, write, request)->
414+
cloudinary.v2.api.transformations(named: true)
415+
sinon.assert.calledWith(request, sinon.match(
416+
query: sinon.match('named=true')
417+
,
418+
"named=true"
419+
))
412420
it "should allow unsafe update of named transformation", ()->
413421
@timeout helper.TIMEOUT_MEDIUM
414422

0 commit comments

Comments
 (0)