Remove unneeded cardId parameters

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2020-07-11 11:58:53 +02:00
parent cd0b3b29f1
commit 6114c28b10
8 changed files with 46 additions and 88 deletions

View File

@@ -54,8 +54,7 @@ class AttachmentApiController extends ApiController {
*
*/
public function display() {
$attachment = $this->attachmentService->display($this->request->getParam('cardId'), $this->request->getParam('attachmentId'));
return $attachment;
return $this->attachmentService->display($this->request->getParam('attachmentId'));
}
/**
@@ -76,7 +75,7 @@ class AttachmentApiController extends ApiController {
*
*/
public function update($data) {
$attachment = $this->attachmentService->update($this->request->getParam('cardId'), $this->request->getParam('attachmentId'), $data);
$attachment = $this->attachmentService->update($this->request->getParam('attachmentId'), $data);
return new DataResponse($attachment, HTTP::STATUS_OK);
}
@@ -87,7 +86,7 @@ class AttachmentApiController extends ApiController {
*
*/
public function delete() {
$attachment = $this->attachmentService->delete($this->request->getParam('cardId'), $this->request->getParam('attachmentId'));
$attachment = $this->attachmentService->delete($this->request->getParam('attachmentId'));
return new DataResponse($attachment, HTTP::STATUS_OK);
}
@@ -98,7 +97,7 @@ class AttachmentApiController extends ApiController {
*
*/
public function restore() {
$attachment = $this->attachmentService->restore($this->request->getParam('cardId'), $this->request->getParam('attachmentId'));
$attachment = $this->attachmentService->restore($this->request->getParam('attachmentId'));
return new DataResponse($attachment, HTTP::STATUS_OK);
}
}

View File

@@ -52,8 +52,8 @@ class AttachmentController extends Controller {
* @return \OCP\AppFramework\Http\Response
* @throws \OCA\Deck\NotFoundException
*/
public function display($cardId, $attachmentId) {
return $this->attachmentService->display($cardId, $attachmentId);
public function display($attachmentId) {
return $this->attachmentService->display($attachmentId);
}
/**
@@ -70,21 +70,21 @@ class AttachmentController extends Controller {
/**
* @NoAdminRequired
*/
public function update($cardId, $attachmentId) {
return $this->attachmentService->update($cardId, $attachmentId, $this->request->getParam('data'));
public function update($attachmentId) {
return $this->attachmentService->update($attachmentId, $this->request->getParam('data'));
}
/**
* @NoAdminRequired
*/
public function delete($cardId, $attachmentId) {
return $this->attachmentService->delete($cardId, $attachmentId);
public function delete($attachmentId) {
return $this->attachmentService->delete($attachmentId);
}
/**
* @NoAdminRequired
*/
public function restore($cardId, $attachmentId) {
return $this->attachmentService->restore($cardId, $attachmentId);
public function restore($attachmentId) {
return $this->attachmentService->restore($attachmentId);
}
}