diff --git a/appinfo/routes.php b/appinfo/routes.php index d0766934c..cd0da7724 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -59,7 +59,7 @@ return [ ['name' => 'card#assignUser', 'url' => '/cards/{cardId}/assign', 'verb' => 'POST'], ['name' => 'card#unassignUser', 'url' => '/cards/{cardId}/assign/{userId}', 'verb' => 'DELETE'], - ['name' => 'attachment#list', 'url' => '/cards/{cardId}/attachments', 'verb' => 'GET'], + ['name' => 'attachment#getAll', 'url' => '/cards/{cardId}/attachments', 'verb' => 'GET'], ['name' => 'attachment#display', 'url' => '/cards/{cardId}/attachment/{attachmentId}', 'verb' => 'GET'], ['name' => 'attachment#create', 'url' => '/cards/{cardId}/attachment', 'verb' => 'POST'], ['name' => 'attachment#update', 'url' => '/cards/{cardId}/attachment/{attachmentId}', 'verb' => 'UPDATE'], diff --git a/js/controller/CardController.js b/js/controller/CardController.js index a713721ff..d52b3960a 100644 --- a/js/controller/CardController.js +++ b/js/controller/CardController.js @@ -59,15 +59,16 @@ app.controller('CardController', function ($scope, $rootScope, $sce, $location, 'File already exists', function(result) { if (result) { - $scope.runUpload(fileItem) + $scope.runUpload(fileItem); } else { // TODO: check for proper number and append it before the file extension + // TODO: iterate over attachments (check if matches "file.name (n)") increase n fileItem.file.name = fileItem.file.name + '.1'; } } ); } else { - $scope.runUpload(fileItem) + $scope.runUpload(fileItem); } }; $scope.uploader.onSuccessItem = function(item, response) { diff --git a/lib/Controller/AttachmentController.php b/lib/Controller/AttachmentController.php index d64a5c7d3..cb6136ed3 100644 --- a/lib/Controller/AttachmentController.php +++ b/lib/Controller/AttachmentController.php @@ -38,7 +38,7 @@ class AttachmentController extends Controller { $this->attachmentService = $attachmentService; } - public function list($cardId) { + public function getAll($cardId) { return $this->attachmentService->getAll($cardId); }