From 2519cf1030cf50f4cd8e36695a56cd7d0d977a72 Mon Sep 17 00:00:00 2001 From: baldo Date: Sat, 13 May 2017 12:47:52 +0200 Subject: [PATCH] Fix: Update of ng-admin broke buttons in admin panel. --- admin/js/views/mailActionButton.js | 6 ++---- admin/js/views/taskActionButton.js | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/admin/js/views/mailActionButton.js b/admin/js/views/mailActionButton.js index cc443ce..bda4a9f 100644 --- a/admin/js/views/mailActionButton.js +++ b/admin/js/views/mailActionButton.js @@ -1,9 +1,7 @@ 'use strict'; angular.module('ffffngAdmin') -.directive('faMailActionButton', function (Restangular, $state, notification, config) { - var pathPrefix = config.rootPath === '/' ? '' : config.rootPath; - +.directive('faMailActionButton', function (Restangular, $state, notification) { var link = function (scope) { scope.label = scope.label || 'ACTION'; scope.icon = scope.icon || 'envelope'; @@ -13,7 +11,7 @@ angular.module('ffffngAdmin') var mail = scope.mail(); Restangular - .one(pathPrefix + '/internal/api/mails/' + scope.action, mail.values.id).put() + .one('mails/' + scope.action, mail.values.id).put() .then(function () { $state.reload() }) .then(function () { notification.log('Done', { addnCls: 'humane-flatty-success' }); }) .catch(function (e) { diff --git a/admin/js/views/taskActionButton.js b/admin/js/views/taskActionButton.js index dbc8887..b818553 100644 --- a/admin/js/views/taskActionButton.js +++ b/admin/js/views/taskActionButton.js @@ -1,9 +1,7 @@ 'use strict'; angular.module('ffffngAdmin') -.directive('faTaskActionButton', function (Restangular, $state, notification, config) { - var pathPrefix = config.rootPath === '/' ? '' : config.rootPath; - +.directive('faTaskActionButton', function (Restangular, $state, notification) { var link = function (scope) { scope.label = scope.label || 'ACTION'; scope.icon = scope.icon || 'play'; @@ -13,7 +11,7 @@ angular.module('ffffngAdmin') var task = scope.task(); Restangular - .one(pathPrefix + '/internal/api/tasks/' + scope.action, task.values.id).put() + .one('tasks/' + scope.action, task.values.id).put() .then(function () { $state.reload() }) .then(function () { notification.log('Done', { addnCls: 'humane-flatty-success' }); }) .catch(function (e) {