From 191920ccc64a464ed968f1ffa4eebf2e505809c0 Mon Sep 17 00:00:00 2001 From: Johannes Wachter Date: Mon, 27 Mar 2017 18:09:22 +0200 Subject: [PATCH] fixed remove single article (#117) --- Resources/public/dist/services/manager.js | 2 +- Resources/public/js/services/manager.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Resources/public/dist/services/manager.js b/Resources/public/dist/services/manager.js index 79657a5dd..87d3fd2d7 100644 --- a/Resources/public/dist/services/manager.js +++ b/Resources/public/dist/services/manager.js @@ -1 +1 @@ -define(["jquery","services/husky/util"],function(a,b){"use strict";var c={url:_.template('/admin/api/articles<% if (typeof id !== "undefined") { %>/<%= id %><% } %><% if (typeof postfix !== "undefined") { %>/<%= postfix %><% } %><% if (typeof version !== "undefined") { %>/<%= version %><% } %>?locale=<%= locale %><% if (typeof action !== "undefined") { %>&action=<%= action %><% } %><% if (typeof ids !== "undefined") { %>&ids=<%= ids.join(",") %><% } %>')};return{url:c.url,load:function(a,d){return b.load(c.url({id:a,locale:d}))},save:function(a,d,e,f){return b.save(c.url({id:d,locale:e,action:f}),d?"PUT":"POST",a)},remove:function(a,d){return"string"==typeof someVar?b.save(c.url({id:a,locale:d}),"DELETE"):b.save(c.url({ids:a,locale:d}),"DELETE")},unpublish:function(a,d){return b.save(c.url({id:a,locale:d,action:"unpublish"}),"POST")},removeDraft:function(a,d){return b.save(c.url({id:a,locale:d,action:"remove-draft"}),"POST")},restoreVersion:function(a,d,e){return b.save(c.url({id:a,postfix:"versions",locale:e,version:d,action:"restore"}),"POST")},getCopyLocaleUrl:function(a,b,d){return[c.url({id:a,locale:b,action:"copy-locale"}),"&dest=",d].join("")},getVersionsUrl:function(a,b){return c.url({id:a,postfix:"versions",locale:b})}}}); \ No newline at end of file +define(["jquery","services/husky/util"],function(a,b){"use strict";var c={url:_.template('/admin/api/articles<% if (typeof id !== "undefined") { %>/<%= id %><% } %><% if (typeof postfix !== "undefined") { %>/<%= postfix %><% } %><% if (typeof version !== "undefined") { %>/<%= version %><% } %>?locale=<%= locale %><% if (typeof action !== "undefined") { %>&action=<%= action %><% } %><% if (typeof ids !== "undefined") { %>&ids=<%= ids.join(",") %><% } %>')};return{url:c.url,load:function(a,d){return b.load(c.url({id:a,locale:d}))},save:function(a,d,e,f){return b.save(c.url({id:d,locale:e,action:f}),d?"PUT":"POST",a)},remove:function(a,d){return"string"==typeof a?b.save(c.url({id:a,locale:d}),"DELETE"):b.save(c.url({ids:a,locale:d}),"DELETE")},unpublish:function(a,d){return b.save(c.url({id:a,locale:d,action:"unpublish"}),"POST")},removeDraft:function(a,d){return b.save(c.url({id:a,locale:d,action:"remove-draft"}),"POST")},restoreVersion:function(a,d,e){return b.save(c.url({id:a,postfix:"versions",locale:e,version:d,action:"restore"}),"POST")},getCopyLocaleUrl:function(a,b,d){return[c.url({id:a,locale:b,action:"copy-locale"}),"&dest=",d].join("")},getVersionsUrl:function(a,b){return c.url({id:a,postfix:"versions",locale:b})}}}); \ No newline at end of file diff --git a/Resources/public/js/services/manager.js b/Resources/public/js/services/manager.js index c3a44625e..029edb636 100644 --- a/Resources/public/js/services/manager.js +++ b/Resources/public/js/services/manager.js @@ -54,7 +54,7 @@ define(['jquery', 'services/husky/util'], function($, Util) { * @param {String} locale */ remove: function(id, locale) { - if (typeof someVar === 'string') { + if (typeof id === 'string') { return Util.save(templates.url({id: id, locale: locale}), 'DELETE'); }