From 993e3d69b65d25106fc0ddd870147e90414dfc5a Mon Sep 17 00:00:00 2001 From: Caluera Date: Sun, 10 Oct 2021 19:12:26 +0200 Subject: [PATCH] add testing example in frontend for assigning a helper --- lib/Controller/TicketApiController.php | 8 ++++---- src/App.vue | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/Controller/TicketApiController.php b/lib/Controller/TicketApiController.php index bdaefb3..cd175d5 100644 --- a/lib/Controller/TicketApiController.php +++ b/lib/Controller/TicketApiController.php @@ -51,14 +51,14 @@ class TicketApiController extends ApiController return new DataResponse($this->service->create($title, $content, $this->userId)); } + + /** * @NoAdminRequired */ - public function update(int $id, string $title, string $content): DataResponse + public function update(): DataResponse { - return $this->handleNotFound(function () use ($id, $title, $content) { - return $this->service->update($id, $title, $content, $this->userId); - }); + return new DataResponse($this->service->assign(44,$this->userId)); } public function destroy(int $id): DataResponse diff --git a/src/App.vue b/src/App.vue index 8d83029..d93efd1 100644 --- a/src/App.vue +++ b/src/App.vue @@ -65,6 +65,13 @@ export default { 'api/v1/tickets/1', { headers: { 'Content-Type': 'application/json', Accept: 'application/json' } }, ).catch(console.error) + axios.put( + 'api/v1/tickets/1', + {}, + { headers: { 'Content-Type': 'application/json', Accept: 'application/json' } } + ).then((response) => { + console.error('added a helper to ticket 2') + }).catch(console.error) }, fetchTickets() { axios.get(