add testing example in frontend for assigning a helper

This commit is contained in:
Caluera 2021-10-10 19:12:26 +02:00
parent 8e44a5ea51
commit 993e3d69b6
2 changed files with 11 additions and 4 deletions

View file

@ -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

View file

@ -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(